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