| 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 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 76 ASSERT(tag == kImportTag); | 76 ASSERT(tag == kImportTag); |
| 77 // Handle imports of other built-in libraries present in the SDK. | 77 // Handle imports of other built-in libraries present in the SDK. |
| 78 if (DartUtils::IsDartIOLibURL(url_chars)) { | 78 if (DartUtils::IsDartIOLibURL(url_chars)) { |
| 79 return Builtin::LoadLibrary(Builtin::kIOLibrary); | 79 return Builtin::LoadLibrary(Builtin::kIOLibrary); |
| 80 } else if (DartUtils::IsDartJsonLibURL(url_chars)) { | 80 } else if (DartUtils::IsDartJsonLibURL(url_chars)) { |
| 81 return Builtin::LoadLibrary(Builtin::kJsonLibrary); | 81 return Builtin::LoadLibrary(Builtin::kJsonLibrary); |
| 82 } else if (DartUtils::IsDartUriLibURL(url_chars)) { | 82 } else if (DartUtils::IsDartUriLibURL(url_chars)) { |
| 83 return Builtin::LoadLibrary(Builtin::kUriLibrary); | 83 return Builtin::LoadLibrary(Builtin::kUriLibrary); |
| 84 } else if (DartUtils::IsDartUtfLibURL(url_chars)) { | 84 } else if (DartUtils::IsDartUtfLibURL(url_chars)) { |
| 85 return Builtin::LoadLibrary(Builtin::kUtfLibrary); | 85 return Builtin::LoadLibrary(Builtin::kUtfLibrary); |
| 86 } else if (DartUtils::IsDartCryptoLibURL(url_chars)) { |
| 87 return Builtin::LoadLibrary(Builtin::kCryptoLibrary); |
| 86 } else { | 88 } else { |
| 87 return Dart_Error("Do not know how to load '%s'", url_chars); | 89 return Dart_Error("Do not know how to load '%s'", url_chars); |
| 88 } | 90 } |
| 89 } | 91 } |
| 90 result = DartUtils::LoadSource(NULL, | 92 result = DartUtils::LoadSource(NULL, |
| 91 library, | 93 library, |
| 92 url, | 94 url, |
| 93 tag, | 95 tag, |
| 94 url_chars, | 96 url_chars, |
| 95 import_map); | 97 import_map); |
| (...skipping 119 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 215 | 217 |
| 216 bool CompilerTest::TestCompileFunction(const Function& function) { | 218 bool CompilerTest::TestCompileFunction(const Function& function) { |
| 217 Isolate* isolate = Isolate::Current(); | 219 Isolate* isolate = Isolate::Current(); |
| 218 ASSERT(isolate != NULL); | 220 ASSERT(isolate != NULL); |
| 219 ASSERT(ClassFinalizer::AllClassesFinalized()); | 221 ASSERT(ClassFinalizer::AllClassesFinalized()); |
| 220 const Error& error = Error::Handle(Compiler::CompileFunction(function)); | 222 const Error& error = Error::Handle(Compiler::CompileFunction(function)); |
| 221 return error.IsNull(); | 223 return error.IsNull(); |
| 222 } | 224 } |
| 223 | 225 |
| 224 } // namespace dart | 226 } // namespace dart |
| OLD | NEW |