| 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 "bin/builtin.h" | 5 #include "bin/builtin.h" |
| 6 #include "include/dart_api.h" | 6 #include "include/dart_api.h" |
| 7 #include "include/dart_debugger_api.h" | 7 #include "include/dart_debugger_api.h" |
| 8 #include "include/dart_mirrors_api.h" | 8 #include "include/dart_mirrors_api.h" |
| 9 #include "include/dart_native_api.h" | 9 #include "include/dart_native_api.h" |
| 10 #include "platform/assert.h" | 10 #include "platform/assert.h" |
| (...skipping 7109 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 7120 " receivePort.handler = (message) {\n" | 7120 " receivePort.handler = (message) {\n" |
| 7121 " receivePort.close();\n" | 7121 " receivePort.close();\n" |
| 7122 " if (message != 'hello') throw new Exception('ShouldNotHappen');\n" | 7122 " if (message != 'hello') throw new Exception('ShouldNotHappen');\n" |
| 7123 " if (exc_parent) throw new Exception('MakeParentExit');\n" | 7123 " if (exc_parent) throw new Exception('MakeParentExit');\n" |
| 7124 " };\n" | 7124 " };\n" |
| 7125 "}\n"; | 7125 "}\n"; |
| 7126 | 7126 |
| 7127 if (Dart_CurrentIsolate() != NULL) { | 7127 if (Dart_CurrentIsolate() != NULL) { |
| 7128 Dart_ExitIsolate(); | 7128 Dart_ExitIsolate(); |
| 7129 } | 7129 } |
| 7130 Dart_Isolate isolate = TestCase::CreateTestIsolate(); | 7130 Dart_Isolate isolate = TestCase::CreateTestIsolate(script_name); |
| 7131 ASSERT(isolate != NULL); | 7131 ASSERT(isolate != NULL); |
| 7132 if (Dart_IsServiceIsolate(isolate)) { |
| 7133 return isolate; |
| 7134 } |
| 7132 Dart_EnterScope(); | 7135 Dart_EnterScope(); |
| 7133 Dart_Handle url = NewString(TestCase::url()); | 7136 Dart_Handle url = NewString(TestCase::url()); |
| 7134 Dart_Handle source = NewString(kScriptChars); | 7137 Dart_Handle source = NewString(kScriptChars); |
| 7135 Dart_Handle result = Dart_SetLibraryTagHandler(TestCase::library_handler); | 7138 Dart_Handle result = Dart_SetLibraryTagHandler(TestCase::library_handler); |
| 7136 EXPECT_VALID(result); | 7139 EXPECT_VALID(result); |
| 7137 Dart_Handle lib = Dart_LoadScript(url, source, 0, 0); | 7140 Dart_Handle lib = Dart_LoadScript(url, source, 0, 0); |
| 7138 EXPECT_VALID(lib); | 7141 EXPECT_VALID(lib); |
| 7139 result = Dart_FinalizeLoading(false); | 7142 result = Dart_FinalizeLoading(false); |
| 7140 EXPECT_VALID(result); | 7143 EXPECT_VALID(result); |
| 7141 Dart_ExitScope(); | 7144 Dart_ExitScope(); |
| (...skipping 1575 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 8717 NewString("main"), | 8720 NewString("main"), |
| 8718 1, | 8721 1, |
| 8719 dart_args); | 8722 dart_args); |
| 8720 int64_t value = 0; | 8723 int64_t value = 0; |
| 8721 result = Dart_IntegerToInt64(result, &value); | 8724 result = Dart_IntegerToInt64(result, &value); |
| 8722 EXPECT_VALID(result); | 8725 EXPECT_VALID(result); |
| 8723 EXPECT_EQ(6, value); | 8726 EXPECT_EQ(6, value); |
| 8724 } | 8727 } |
| 8725 | 8728 |
| 8726 } // namespace dart | 8729 } // namespace dart |
| OLD | NEW |