| 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 69 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 80 return DartUtils::ReadStringFromFile(source_path); | 80 return DartUtils::ReadStringFromFile(source_path); |
| 81 } | 81 } |
| 82 | 82 |
| 83 | 83 |
| 84 void Builtin::SetNativeResolver(BuiltinLibraryId id) { | 84 void Builtin::SetNativeResolver(BuiltinLibraryId id) { |
| 85 UNREACHABLE(); | 85 UNREACHABLE(); |
| 86 } | 86 } |
| 87 | 87 |
| 88 | 88 |
| 89 Dart_Handle Builtin::LoadLibrary(Dart_Handle url, BuiltinLibraryId id) { | 89 Dart_Handle Builtin::LoadLibrary(Dart_Handle url, BuiltinLibraryId id) { |
| 90 Dart_Handle library = Dart_LoadLibrary(url, Source(id)); | 90 Dart_Handle library = Dart_LoadLibrary(url, Source(id), 0, 0); |
| 91 if (!Dart_IsError(library) && (builtin_libraries_[id].has_natives_)) { | 91 if (!Dart_IsError(library) && (builtin_libraries_[id].has_natives_)) { |
| 92 // Setup the native resolver for built in library functions. | 92 // Setup the native resolver for built in library functions. |
| 93 DART_CHECK_VALID( | 93 DART_CHECK_VALID( |
| 94 Dart_SetNativeResolver(library, NativeLookup, NativeSymbol)); | 94 Dart_SetNativeResolver(library, NativeLookup, NativeSymbol)); |
| 95 } | 95 } |
| 96 if (builtin_libraries_[id].patch_url_ != NULL) { | 96 if (builtin_libraries_[id].patch_url_ != NULL) { |
| 97 ASSERT(builtin_libraries_[id].patch_paths_ != NULL); | 97 ASSERT(builtin_libraries_[id].patch_paths_ != NULL); |
| 98 LoadPatchFiles(library, | 98 LoadPatchFiles(library, |
| 99 builtin_libraries_[id].patch_url_, | 99 builtin_libraries_[id].patch_url_, |
| 100 builtin_libraries_[id].patch_paths_); | 100 builtin_libraries_[id].patch_paths_); |
| (...skipping 10 matching lines...) Expand all Loading... |
| 111 Dart_Handle library = Dart_LookupLibrary(url); | 111 Dart_Handle library = Dart_LookupLibrary(url); |
| 112 if (Dart_IsError(library)) { | 112 if (Dart_IsError(library)) { |
| 113 library = LoadLibrary(url, id); | 113 library = LoadLibrary(url, id); |
| 114 } | 114 } |
| 115 DART_CHECK_VALID(library); | 115 DART_CHECK_VALID(library); |
| 116 return library; | 116 return library; |
| 117 } | 117 } |
| 118 | 118 |
| 119 } // namespace bin | 119 } // namespace bin |
| 120 } // namespace dart | 120 } // namespace dart |
| OLD | NEW |