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 "bin/builtin.h" |
6 #include "platform/assert.h" | 7 #include "platform/assert.h" |
7 #include "platform/json.h" | 8 #include "platform/json.h" |
8 #include "platform/utils.h" | 9 #include "platform/utils.h" |
9 #include "vm/class_finalizer.h" | 10 #include "vm/class_finalizer.h" |
10 #include "vm/dart_api_impl.h" | 11 #include "vm/dart_api_impl.h" |
11 #include "vm/dart_api_state.h" | 12 #include "vm/dart_api_state.h" |
12 #include "vm/thread.h" | 13 #include "vm/thread.h" |
13 #include "vm/unit_test.h" | 14 #include "vm/unit_test.h" |
14 #include "vm/verifier.h" | 15 #include "vm/verifier.h" |
15 | 16 |
(...skipping 5982 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5998 " a.method(5);\n" | 5999 " a.method(5);\n" |
5999 " return a.field;\n" | 6000 " return a.field;\n" |
6000 "}\n" | 6001 "}\n" |
6001 "m5() => new B(3);\n" | 6002 "m5() => new B(3);\n" |
6002 "m6() {\n" | 6003 "m6() {\n" |
6003 " var b = new B.named(8);\n" | 6004 " var b = new B.named(8);\n" |
6004 " return b.val;\n" | 6005 " return b.val;\n" |
6005 "}\n" | 6006 "}\n" |
6006 ; // NOLINT | 6007 ; // NOLINT |
6007 | 6008 |
| 6009 bin::Builtin::SetNativeResolver(bin::Builtin::kBuiltinLibrary); |
| 6010 bin::Builtin::SetNativeResolver(bin::Builtin::kIOLibrary); |
| 6011 |
6008 Dart_Handle result = Dart_SetLibraryTagHandler(library_handler); | 6012 Dart_Handle result = Dart_SetLibraryTagHandler(library_handler); |
6009 EXPECT_VALID(result); | 6013 EXPECT_VALID(result); |
6010 | 6014 |
6011 Dart_Handle url = NewString("theLibrary"); | 6015 Dart_Handle url = NewString("theLibrary"); |
6012 Dart_Handle source = NewString(kLibraryChars); | 6016 Dart_Handle source = NewString(kLibraryChars); |
6013 result = Dart_LoadLibrary(url, source); | 6017 result = Dart_LoadLibrary(url, source); |
6014 EXPECT_VALID(result); | 6018 EXPECT_VALID(result); |
6015 | 6019 |
6016 const String& patch_url = String::Handle(String::New("theLibrary patch")); | 6020 const String& patch_url = String::Handle(String::New("theLibrary patch")); |
6017 const String& patch_source = String::Handle(String::New(kPatchChars)); | 6021 const String& patch_source = String::Handle(String::New(kPatchChars)); |
(...skipping 1709 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
7727 NewString("main"), | 7731 NewString("main"), |
7728 0, | 7732 0, |
7729 NULL); | 7733 NULL); |
7730 int64_t value = 0; | 7734 int64_t value = 0; |
7731 result = Dart_IntegerToInt64(result, &value); | 7735 result = Dart_IntegerToInt64(result, &value); |
7732 EXPECT_VALID(result); | 7736 EXPECT_VALID(result); |
7733 EXPECT_EQ(260, value); | 7737 EXPECT_EQ(260, value); |
7734 } | 7738 } |
7735 | 7739 |
7736 } // namespace dart | 7740 } // namespace dart |
OLD | NEW |