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/dartutils.h" | 5 #include "bin/dartutils.h" |
6 | 6 |
7 #include "bin/crypto.h" | 7 #include "bin/crypto.h" |
8 #include "bin/directory.h" | 8 #include "bin/directory.h" |
9 #include "bin/extensions.h" | 9 #include "bin/extensions.h" |
10 #include "bin/file.h" | 10 #include "bin/file.h" |
(...skipping 672 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
683 RETURN_IF_ERROR(url); | 683 RETURN_IF_ERROR(url); |
684 Dart_Handle isolate_lib = Dart_LookupLibrary(url); | 684 Dart_Handle isolate_lib = Dart_LookupLibrary(url); |
685 RETURN_IF_ERROR(isolate_lib); | 685 RETURN_IF_ERROR(isolate_lib); |
686 url = NewString(kInternalLibURL); | 686 url = NewString(kInternalLibURL); |
687 RETURN_IF_ERROR(url); | 687 RETURN_IF_ERROR(url); |
688 Dart_Handle internal_lib = Dart_LookupLibrary(url); | 688 Dart_Handle internal_lib = Dart_LookupLibrary(url); |
689 RETURN_IF_ERROR(internal_lib); | 689 RETURN_IF_ERROR(internal_lib); |
690 Dart_Handle builtin_lib = | 690 Dart_Handle builtin_lib = |
691 Builtin::LoadAndCheckLibrary(Builtin::kBuiltinLibrary); | 691 Builtin::LoadAndCheckLibrary(Builtin::kBuiltinLibrary); |
692 RETURN_IF_ERROR(builtin_lib); | 692 RETURN_IF_ERROR(builtin_lib); |
| 693 Builtin::SetNativeResolver(Builtin::kBuiltinLibrary); |
693 Dart_Handle io_lib = Builtin::LoadAndCheckLibrary(Builtin::kIOLibrary); | 694 Dart_Handle io_lib = Builtin::LoadAndCheckLibrary(Builtin::kIOLibrary); |
694 RETURN_IF_ERROR(io_lib); | 695 RETURN_IF_ERROR(io_lib); |
| 696 Builtin::SetNativeResolver(Builtin::kIOLibrary); |
695 | 697 |
696 // Setup the builtin library in a persistent handle attached the isolate | 698 // Setup the builtin library in a persistent handle attached the isolate |
697 // specific data as we seem to lookup and use builtin lib a lot. | 699 // specific data as we seem to lookup and use builtin lib a lot. |
698 IsolateData* isolate_data = | 700 IsolateData* isolate_data = |
699 reinterpret_cast<IsolateData*>(Dart_CurrentIsolateData()); | 701 reinterpret_cast<IsolateData*>(Dart_CurrentIsolateData()); |
700 ASSERT(isolate_data != NULL); | 702 ASSERT(isolate_data != NULL); |
701 isolate_data->set_builtin_lib(builtin_lib); | 703 isolate_data->set_builtin_lib(builtin_lib); |
702 | 704 |
703 // We need to ensure that all the scripts loaded so far are finalized | 705 // We need to ensure that all the scripts loaded so far are finalized |
704 // as we are about to invoke some Dart code below to setup closures. | 706 // as we are about to invoke some Dart code below to setup closures. |
(...skipping 475 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1180 new CObjectString(CObject::NewString(os_error->message())); | 1182 new CObjectString(CObject::NewString(os_error->message())); |
1181 CObjectArray* result = new CObjectArray(CObject::NewArray(3)); | 1183 CObjectArray* result = new CObjectArray(CObject::NewArray(3)); |
1182 result->SetAt(0, new CObjectInt32(CObject::NewInt32(kOSError))); | 1184 result->SetAt(0, new CObjectInt32(CObject::NewInt32(kOSError))); |
1183 result->SetAt(1, new CObjectInt32(CObject::NewInt32(os_error->code()))); | 1185 result->SetAt(1, new CObjectInt32(CObject::NewInt32(os_error->code()))); |
1184 result->SetAt(2, error_message); | 1186 result->SetAt(2, error_message); |
1185 return result; | 1187 return result; |
1186 } | 1188 } |
1187 | 1189 |
1188 } // namespace bin | 1190 } // namespace bin |
1189 } // namespace dart | 1191 } // namespace dart |
OLD | NEW |