| 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 "vm/unit_test.h" | 5 #include "vm/unit_test.h" |
| 6 | 6 |
| 7 #include <stdio.h> | 7 #include <stdio.h> |
| 8 | 8 |
| 9 #include "bin/builtin.h" | 9 #include "bin/builtin.h" |
| 10 #include "bin/dartutils.h" | 10 #include "bin/dartutils.h" |
| (...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 97 return Builtin::LoadAndCheckLibrary(Builtin::kBuiltinLibrary); | 97 return Builtin::LoadAndCheckLibrary(Builtin::kBuiltinLibrary); |
| 98 } else { | 98 } else { |
| 99 return DartUtils::NewError("Do not know how to load '%s'", url_chars); | 99 return DartUtils::NewError("Do not know how to load '%s'", url_chars); |
| 100 } | 100 } |
| 101 } | 101 } |
| 102 if (is_io_library) { | 102 if (is_io_library) { |
| 103 ASSERT(tag == Dart_kSourceTag); | 103 ASSERT(tag == Dart_kSourceTag); |
| 104 return Dart_LoadSource(library, | 104 return Dart_LoadSource(library, |
| 105 url, | 105 url, |
| 106 Builtin::PartSource(Builtin::kIOLibrary, | 106 Builtin::PartSource(Builtin::kIOLibrary, |
| 107 url_chars)); | 107 url_chars), |
| 108 0, 0); |
| 108 } | 109 } |
| 109 return DartUtils::LoadSource(library, url, tag, url_chars); | 110 return DartUtils::LoadSource(library, url, tag, url_chars); |
| 110 } | 111 } |
| 111 | 112 |
| 112 | 113 |
| 113 Dart_Handle TestCase::LoadTestScript(const char* script, | 114 Dart_Handle TestCase::LoadTestScript(const char* script, |
| 114 Dart_NativeEntryResolver resolver, | 115 Dart_NativeEntryResolver resolver, |
| 115 const char* lib_url, | 116 const char* lib_url, |
| 116 bool finalize_classes) { | 117 bool finalize_classes) { |
| 117 Dart_Handle url = NewString(lib_url); | 118 Dart_Handle url = NewString(lib_url); |
| (...skipping 128 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 246 Isolate* isolate = Isolate::Current(); | 247 Isolate* isolate = Isolate::Current(); |
| 247 ASSERT(isolate != NULL); | 248 ASSERT(isolate != NULL); |
| 248 ASSERT(ClassFinalizer::AllClassesFinalized()); | 249 ASSERT(ClassFinalizer::AllClassesFinalized()); |
| 249 const Error& error = Error::Handle(Compiler::CompileFunction(isolate, | 250 const Error& error = Error::Handle(Compiler::CompileFunction(isolate, |
| 250 function)); | 251 function)); |
| 251 return error.IsNull(); | 252 return error.IsNull(); |
| 252 } | 253 } |
| 253 | 254 |
| 254 | 255 |
| 255 } // namespace dart | 256 } // namespace dart |
| OLD | NEW |