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 <stdio.h> | 5 #include <stdio.h> |
6 | 6 |
7 #include "include/dart_api.h" | 7 #include "include/dart_api.h" |
8 | 8 |
9 #include "bin/builtin.h" | 9 #include "bin/builtin.h" |
10 #include "bin/dartutils.h" | 10 #include "bin/dartutils.h" |
(...skipping 101 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
112 | 112 |
113 void Builtin::SetNativeResolver(BuiltinLibraryId id) { | 113 void Builtin::SetNativeResolver(BuiltinLibraryId id) { |
114 UNREACHABLE(); | 114 UNREACHABLE(); |
115 } | 115 } |
116 | 116 |
117 | 117 |
118 Dart_Handle Builtin::LoadLibrary(Dart_Handle url, BuiltinLibraryId id) { | 118 Dart_Handle Builtin::LoadLibrary(Dart_Handle url, BuiltinLibraryId id) { |
119 ASSERT(static_cast<int>(id) >= 0); | 119 ASSERT(static_cast<int>(id) >= 0); |
120 ASSERT(static_cast<int>(id) < num_libs_); | 120 ASSERT(static_cast<int>(id) < num_libs_); |
121 | 121 |
122 Dart_Handle library = Dart_LoadLibrary(url, Source(id), 0, 0); | 122 Dart_Handle library = Dart_LoadLibrary(url, Dart_Null(), Source(id), 0, 0); |
123 if (!Dart_IsError(library) && (builtin_libraries_[id].has_natives_)) { | 123 if (!Dart_IsError(library) && (builtin_libraries_[id].has_natives_)) { |
124 // Setup the native resolver for built in library functions. | 124 // Setup the native resolver for built in library functions. |
125 DART_CHECK_VALID( | 125 DART_CHECK_VALID( |
126 Dart_SetNativeResolver(library, NativeLookup, NativeSymbol)); | 126 Dart_SetNativeResolver(library, NativeLookup, NativeSymbol)); |
127 } | 127 } |
128 if (builtin_libraries_[id].patch_url_ != NULL) { | 128 if (builtin_libraries_[id].patch_url_ != NULL) { |
129 ASSERT(builtin_libraries_[id].patch_paths_ != NULL); | 129 ASSERT(builtin_libraries_[id].patch_paths_ != NULL); |
130 LoadPatchFiles(library, | 130 LoadPatchFiles(library, |
131 builtin_libraries_[id].patch_url_, | 131 builtin_libraries_[id].patch_url_, |
132 builtin_libraries_[id].patch_paths_); | 132 builtin_libraries_[id].patch_paths_); |
(...skipping 23 matching lines...) Expand all Loading... |
156 Dart_Handle url = DartUtils::NewString(builtin_libraries_[id].url_); | 156 Dart_Handle url = DartUtils::NewString(builtin_libraries_[id].url_); |
157 Dart_Handle library = Dart_LookupLibrary(url); | 157 Dart_Handle library = Dart_LookupLibrary(url); |
158 if (Dart_IsError(library)) { | 158 if (Dart_IsError(library)) { |
159 library = LoadLibrary(url, id); | 159 library = LoadLibrary(url, id); |
160 } | 160 } |
161 return library; | 161 return library; |
162 } | 162 } |
163 | 163 |
164 } // namespace bin | 164 } // namespace bin |
165 } // namespace dart | 165 } // namespace dart |
OLD | NEW |