| OLD | NEW |
| 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file |
| 2 // for details. All rights reserved. Use of this source code is governed by a | 2 // for details. All rights reserved. Use of this source code is governed by a |
| 3 // BSD-style license that can be found in the LICENSE file. | 3 // BSD-style license that can be found in the LICENSE file. |
| 4 | 4 |
| 5 #include "include/dart_api.h" | 5 #include "include/dart_api.h" |
| 6 #include "platform/assert.h" | 6 #include "platform/assert.h" |
| 7 #include "platform/json.h" | 7 #include "platform/json.h" |
| 8 #include "platform/utils.h" | 8 #include "platform/utils.h" |
| 9 #include "vm/class_finalizer.h" | 9 #include "vm/class_finalizer.h" |
| 10 #include "vm/dart_api_impl.h" | 10 #include "vm/dart_api_impl.h" |
| (...skipping 114 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 125 | 125 |
| 126 | 126 |
| 127 static Dart_NativeFunction PropagateError_native_lookup( | 127 static Dart_NativeFunction PropagateError_native_lookup( |
| 128 Dart_Handle name, int argument_count) { | 128 Dart_Handle name, int argument_count) { |
| 129 return reinterpret_cast<Dart_NativeFunction>(&PropagateErrorNative); | 129 return reinterpret_cast<Dart_NativeFunction>(&PropagateErrorNative); |
| 130 } | 130 } |
| 131 | 131 |
| 132 | 132 |
| 133 TEST_CASE(Dart_PropagateError) { | 133 TEST_CASE(Dart_PropagateError) { |
| 134 const char* kScriptChars = | 134 const char* kScriptChars = |
| 135 "void raiseCompileError() {\n" | 135 "raiseCompileError() {\n" |
| 136 " return badIdent;\n" | 136 " return badIdent;\n" |
| 137 "}\n" | 137 "}\n" |
| 138 "\n" | 138 "\n" |
| 139 "void throwException() {\n" | 139 "void throwException() {\n" |
| 140 " throw new Exception('myException');\n" | 140 " throw new Exception('myException');\n" |
| 141 "}\n" | 141 "}\n" |
| 142 "\n" | 142 "\n" |
| 143 "void nativeFunc(closure) native 'Test_nativeFunc';\n" | 143 "void nativeFunc(closure) native 'Test_nativeFunc';\n" |
| 144 "\n" | 144 "\n" |
| 145 "void Func1() {\n" | 145 "void Func1() {\n" |
| (...skipping 6014 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 6160 EXPECT_VALID(result); | 6160 EXPECT_VALID(result); |
| 6161 EXPECT(Dart_IsInteger(result)); | 6161 EXPECT(Dart_IsInteger(result)); |
| 6162 int64_t value = 0; | 6162 int64_t value = 0; |
| 6163 EXPECT_VALID(Dart_IntegerToInt64(result, &value)); | 6163 EXPECT_VALID(Dart_IntegerToInt64(result, &value)); |
| 6164 EXPECT_EQ(0, value); | 6164 EXPECT_EQ(0, value); |
| 6165 } | 6165 } |
| 6166 | 6166 |
| 6167 #endif // defined(TARGET_ARCH_IA32) || defined(TARGET_ARCH_X64). | 6167 #endif // defined(TARGET_ARCH_IA32) || defined(TARGET_ARCH_X64). |
| 6168 | 6168 |
| 6169 } // namespace dart | 6169 } // namespace dart |
| OLD | NEW |