OLD | NEW |
1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2013, 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 "include/dart_mirrors_api.h" | 6 #include "include/dart_mirrors_api.h" |
7 #include "include/dart_native_api.h" | 7 #include "include/dart_native_api.h" |
8 | 8 |
9 #include "platform/assert.h" | 9 #include "platform/assert.h" |
10 #include "vm/bigint_operations.h" | 10 #include "vm/bigint_operations.h" |
(...skipping 3853 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3864 ? Symbols::Empty() | 3864 ? Symbols::Empty() |
3865 : String::Cast(prefix_object); | 3865 : String::Cast(prefix_object); |
3866 if (prefix_vm.IsNull()) { | 3866 if (prefix_vm.IsNull()) { |
3867 RETURN_TYPE_ERROR(isolate, prefix, String); | 3867 RETURN_TYPE_ERROR(isolate, prefix, String); |
3868 } | 3868 } |
3869 CHECK_CALLBACK_STATE(isolate); | 3869 CHECK_CALLBACK_STATE(isolate); |
3870 | 3870 |
3871 const String& prefix_symbol = | 3871 const String& prefix_symbol = |
3872 String::Handle(isolate, Symbols::New(prefix_vm)); | 3872 String::Handle(isolate, Symbols::New(prefix_vm)); |
3873 const Namespace& import_ns = Namespace::Handle( | 3873 const Namespace& import_ns = Namespace::Handle( |
3874 Namespace::New(import_vm, Array::Handle(), Array::Handle())); | 3874 Namespace::New(import_vm, Object::null_array(), Object::null_array())); |
3875 if (prefix_vm.Length() == 0) { | 3875 if (prefix_vm.Length() == 0) { |
3876 library_vm.AddImport(import_ns); | 3876 library_vm.AddImport(import_ns); |
3877 } else { | 3877 } else { |
3878 LibraryPrefix& library_prefix = LibraryPrefix::Handle(); | 3878 LibraryPrefix& library_prefix = LibraryPrefix::Handle(); |
3879 library_prefix = library_vm.LookupLocalLibraryPrefix(prefix_symbol); | 3879 library_prefix = library_vm.LookupLocalLibraryPrefix(prefix_symbol); |
3880 if (!library_prefix.IsNull()) { | 3880 if (!library_prefix.IsNull()) { |
3881 library_prefix.AddImport(import_ns); | 3881 library_prefix.AddImport(import_ns); |
3882 } else { | 3882 } else { |
3883 library_prefix = LibraryPrefix::New(prefix_symbol, import_ns); | 3883 library_prefix = LibraryPrefix::New(prefix_symbol, import_ns); |
3884 library_vm.AddObject(library_prefix, prefix_symbol); | 3884 library_vm.AddObject(library_prefix, prefix_symbol); |
(...skipping 107 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3992 } | 3992 } |
3993 { | 3993 { |
3994 NoGCScope no_gc; | 3994 NoGCScope no_gc; |
3995 RawObject* raw_obj = obj.raw(); | 3995 RawObject* raw_obj = obj.raw(); |
3996 isolate->heap()->SetPeer(raw_obj, peer); | 3996 isolate->heap()->SetPeer(raw_obj, peer); |
3997 } | 3997 } |
3998 return Api::Success(); | 3998 return Api::Success(); |
3999 } | 3999 } |
4000 | 4000 |
4001 } // namespace dart | 4001 } // namespace dart |
OLD | NEW |