| 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 68 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 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)) { | 81 } else if (DartUtils::IsDartJsonLibURL(url_chars)) { |
| 82 return Builtin::LoadAndCheckLibrary(Builtin::kJsonLibrary); | 82 return Builtin::LoadAndCheckLibrary(Builtin::kJsonLibrary); |
| 83 } else if (DartUtils::IsDartUriLibURL(url_chars)) { | 83 } else if (DartUtils::IsDartUriLibURL(url_chars)) { |
| 84 return Builtin::LoadAndCheckLibrary(Builtin::kUriLibrary); | 84 return Builtin::LoadAndCheckLibrary(Builtin::kUriLibrary); |
| 85 } else if (DartUtils::IsDartUtfLibURL(url_chars)) { | 85 } else if (DartUtils::IsDartUtfLibURL(url_chars)) { |
| 86 return Builtin::LoadAndCheckLibrary(Builtin::kUtfLibrary); | 86 return Builtin::LoadAndCheckLibrary(Builtin::kUtfLibrary); |
| 87 } else if (DartUtils::IsDartCryptoLibURL(url_chars)) { | 87 } else if (DartUtils::IsDartCryptoLibURL(url_chars)) { |
| 88 return Builtin::LoadAndCheckLibrary(Builtin::kCryptoLibrary); | 88 return Builtin::LoadAndCheckLibrary(Builtin::kCryptoLibrary); |
| 89 } else if (DartUtils::IsDartBuiltinLibURL(url_chars)) { |
| 90 return Builtin::LoadAndCheckLibrary(Builtin::kBuiltinLibrary); |
| 89 } else { | 91 } else { |
| 90 return Dart_Error("Do not know how to load '%s'", url_chars); | 92 return Dart_Error("Do not know how to load '%s'", url_chars); |
| 91 } | 93 } |
| 92 } | 94 } |
| 93 return DartUtils::LoadSource(NULL, | 95 return DartUtils::LoadSource(NULL, |
| 94 library, | 96 library, |
| 95 url, | 97 url, |
| 96 tag, | 98 tag, |
| 97 url_chars); | 99 url_chars); |
| 98 } | 100 } |
| (...skipping 116 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 |