| 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" |
| 11 #include "bin/io_natives.h" | 11 #include "bin/io_natives.h" |
| 12 | 12 |
| 13 Builtin::builtin_lib_props Builtin::builtin_libraries_[] = { | 13 Builtin::builtin_lib_props Builtin::builtin_libraries_[] = { |
| 14 /* { url_, source_, patch_url_, patch_source_, has_natives_ } */ | 14 /* { url_, source_, patch_url_, patch_source_, has_natives_ } */ |
| 15 { DartUtils::kBuiltinLibURL, builtin_source_, NULL, NULL, true }, | 15 { DartUtils::kBuiltinLibURL, builtin_source_, NULL, NULL, true }, |
| 16 { DartUtils::kJsonLibURL, json_source_, NULL, NULL, false }, | 16 { DartUtils::kJsonLibURL, json_source_, |
| 17 DartUtils::kJsonLibPatchURL, json_patch_, false }, |
| 17 { DartUtils::kUriLibURL, uri_source_, NULL, NULL, false }, | 18 { DartUtils::kUriLibURL, uri_source_, NULL, NULL, false }, |
| 18 { DartUtils::kCryptoLibURL, crypto_source_, NULL, NULL, false }, | 19 { DartUtils::kCryptoLibURL, crypto_source_, NULL, NULL, false }, |
| 19 { DartUtils::kIOLibURL, io_source_, | 20 { DartUtils::kIOLibURL, io_source_, |
| 20 DartUtils::kIOLibPatchURL, io_patch_, true }, | 21 DartUtils::kIOLibPatchURL, io_patch_, true }, |
| 21 { DartUtils::kUtfLibURL, utf_source_, NULL, NULL, false } | 22 { DartUtils::kUtfLibURL, utf_source_, NULL, NULL, false } |
| 22 }; | 23 }; |
| 23 | 24 |
| 24 | 25 |
| 25 Dart_Handle Builtin::Source(BuiltinLibraryId id) { | 26 Dart_Handle Builtin::Source(BuiltinLibraryId id) { |
| 26 ASSERT((sizeof(builtin_libraries_) / sizeof(builtin_lib_props)) == | 27 ASSERT((sizeof(builtin_libraries_) / sizeof(builtin_lib_props)) == |
| (...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 61 Dart_Handle patch_url = | 62 Dart_Handle patch_url = |
| 62 DartUtils::NewString(builtin_libraries_[id].patch_url_); | 63 DartUtils::NewString(builtin_libraries_[id].patch_url_); |
| 63 Dart_Handle patch_source = | 64 Dart_Handle patch_source = |
| 64 DartUtils::NewString(builtin_libraries_[id].patch_source_); | 65 DartUtils::NewString(builtin_libraries_[id].patch_source_); |
| 65 DART_CHECK_VALID(Dart_LoadPatch(library, patch_url, patch_source)); | 66 DART_CHECK_VALID(Dart_LoadPatch(library, patch_url, patch_source)); |
| 66 } | 67 } |
| 67 } | 68 } |
| 68 DART_CHECK_VALID(library); | 69 DART_CHECK_VALID(library); |
| 69 return library; | 70 return library; |
| 70 } | 71 } |
| OLD | NEW |