| 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 6263 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 6274 } | 6274 } |
| 6275 Dart_Isolate isolate = TestCase::CreateTestIsolate(); | 6275 Dart_Isolate isolate = TestCase::CreateTestIsolate(); |
| 6276 ASSERT(isolate != NULL); | 6276 ASSERT(isolate != NULL); |
| 6277 Dart_EnterScope(); | 6277 Dart_EnterScope(); |
| 6278 Dart_Handle url = NewString(TestCase::url()); | 6278 Dart_Handle url = NewString(TestCase::url()); |
| 6279 Dart_Handle source = NewString(kScriptChars); | 6279 Dart_Handle source = NewString(kScriptChars); |
| 6280 Dart_Handle result = Dart_SetLibraryTagHandler(TestCase::library_handler); | 6280 Dart_Handle result = Dart_SetLibraryTagHandler(TestCase::library_handler); |
| 6281 EXPECT_VALID(result); | 6281 EXPECT_VALID(result); |
| 6282 Dart_Handle lib = Dart_LoadScript(url, source, 0, 0); | 6282 Dart_Handle lib = Dart_LoadScript(url, source, 0, 0); |
| 6283 EXPECT_VALID(lib); | 6283 EXPECT_VALID(lib); |
| 6284 result = Dart_MakeIsolateRunnable(); |
| 6285 EXPECT_VALID(result); |
| 6284 Dart_ExitScope(); | 6286 Dart_ExitScope(); |
| 6285 return true; | 6287 return true; |
| 6286 } | 6288 } |
| 6287 | 6289 |
| 6288 | 6290 |
| 6289 // The error string from the last unhandled exception. This value is only | 6291 // The error string from the last unhandled exception. This value is only |
| 6290 // valid until the next Dart_ExitScope(). | 6292 // valid until the next Dart_ExitScope(). |
| 6291 static char* last_exception = NULL; | 6293 static char* last_exception = NULL; |
| 6292 | 6294 |
| 6293 | 6295 |
| (...skipping 1245 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 7539 NULL); | 7541 NULL); |
| 7540 int64_t value = 0; | 7542 int64_t value = 0; |
| 7541 result = Dart_IntegerToInt64(result, &value); | 7543 result = Dart_IntegerToInt64(result, &value); |
| 7542 EXPECT_VALID(result); | 7544 EXPECT_VALID(result); |
| 7543 EXPECT_EQ(260, value); | 7545 EXPECT_EQ(260, value); |
| 7544 } | 7546 } |
| 7545 | 7547 |
| 7546 #endif // defined(TARGET_ARCH_IA32) || defined(TARGET_ARCH_X64). | 7548 #endif // defined(TARGET_ARCH_IA32) || defined(TARGET_ARCH_X64). |
| 7547 | 7549 |
| 7548 } // namespace dart | 7550 } // namespace dart |
| OLD | NEW |