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 "vm/unit_test.h" | 7 #include "vm/unit_test.h" |
8 | 8 |
9 #include "bin/builtin.h" | 9 #include "bin/builtin.h" |
10 #include "bin/dartutils.h" | 10 #include "bin/dartutils.h" |
(...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
71 Dart_Handle builtin_lib = | 71 Dart_Handle builtin_lib = |
72 Builtin::LoadAndCheckLibrary(Builtin::kBuiltinLibrary); | 72 Builtin::LoadAndCheckLibrary(Builtin::kBuiltinLibrary); |
73 DART_CHECK_VALID(builtin_lib); | 73 DART_CHECK_VALID(builtin_lib); |
74 return DartUtils::CanonicalizeURL(NULL, library, url_chars); | 74 return DartUtils::CanonicalizeURL(NULL, library, url_chars); |
75 } | 75 } |
76 if (is_dart_scheme_url) { | 76 if (is_dart_scheme_url) { |
77 ASSERT(tag == kImportTag); | 77 ASSERT(tag == kImportTag); |
78 // Handle imports of other built-in libraries present in the SDK. | 78 // Handle imports of other built-in libraries present in the SDK. |
79 if (DartUtils::IsDartIOLibURL(url_chars)) { | 79 if (DartUtils::IsDartIOLibURL(url_chars)) { |
80 return Builtin::LoadAndCheckLibrary(Builtin::kIOLibrary); | 80 return Builtin::LoadAndCheckLibrary(Builtin::kIOLibrary); |
81 } else if (DartUtils::IsDartJsonLibURL(url_chars)) { | |
82 return Builtin::LoadAndCheckLibrary(Builtin::kJsonLibrary); | |
83 } else if (DartUtils::IsDartUriLibURL(url_chars)) { | |
84 return Builtin::LoadAndCheckLibrary(Builtin::kUriLibrary); | |
85 } else if (DartUtils::IsDartUtfLibURL(url_chars)) { | |
86 return Builtin::LoadAndCheckLibrary(Builtin::kUtfLibrary); | |
87 } else if (DartUtils::IsDartCryptoLibURL(url_chars)) { | |
88 return Builtin::LoadAndCheckLibrary(Builtin::kCryptoLibrary); | |
89 } else if (DartUtils::IsDartBuiltinLibURL(url_chars)) { | 81 } else if (DartUtils::IsDartBuiltinLibURL(url_chars)) { |
90 return Builtin::LoadAndCheckLibrary(Builtin::kBuiltinLibrary); | 82 return Builtin::LoadAndCheckLibrary(Builtin::kBuiltinLibrary); |
91 } else { | 83 } else { |
92 return Dart_Error("Do not know how to load '%s'", url_chars); | 84 return Dart_Error("Do not know how to load '%s'", url_chars); |
93 } | 85 } |
94 } | 86 } |
95 return DartUtils::LoadSource(NULL, | 87 return DartUtils::LoadSource(NULL, |
96 library, | 88 library, |
97 url, | 89 url, |
98 tag, | 90 tag, |
(...skipping 118 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
217 | 209 |
218 bool CompilerTest::TestCompileFunction(const Function& function) { | 210 bool CompilerTest::TestCompileFunction(const Function& function) { |
219 Isolate* isolate = Isolate::Current(); | 211 Isolate* isolate = Isolate::Current(); |
220 ASSERT(isolate != NULL); | 212 ASSERT(isolate != NULL); |
221 ASSERT(ClassFinalizer::AllClassesFinalized()); | 213 ASSERT(ClassFinalizer::AllClassesFinalized()); |
222 const Error& error = Error::Handle(Compiler::CompileFunction(function)); | 214 const Error& error = Error::Handle(Compiler::CompileFunction(function)); |
223 return error.IsNull(); | 215 return error.IsNull(); |
224 } | 216 } |
225 | 217 |
226 } // namespace dart | 218 } // namespace dart |
OLD | NEW |