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 85 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
96 url_chars, | 96 url_chars, |
97 import_map); | 97 import_map); |
98 if (!Dart_IsError(result) && (tag == kImportTag)) { | 98 if (!Dart_IsError(result) && (tag == kImportTag)) { |
99 Builtin::ImportLibrary(result, Builtin::kBuiltinLibrary); | 99 Builtin::ImportLibrary(result, Builtin::kBuiltinLibrary); |
100 } | 100 } |
101 return result; | 101 return result; |
102 } | 102 } |
103 | 103 |
104 | 104 |
105 Dart_Handle TestCase::LoadTestScript(const char* script, | 105 Dart_Handle TestCase::LoadTestScript(const char* script, |
106 Dart_NativeEntryResolver resolver) { | 106 Dart_NativeEntryResolver resolver, |
| 107 Dart_Handle import_map) { |
107 Dart_Handle url = Dart_NewString(TestCase::url()); | 108 Dart_Handle url = Dart_NewString(TestCase::url()); |
108 Dart_Handle source = Dart_NewString(script); | 109 Dart_Handle source = Dart_NewString(script); |
109 Dart_Handle import_map = Dart_NewList(0); | |
110 Dart_Handle lib = Dart_LoadScript(url, source, LibraryTagHandler, import_map); | 110 Dart_Handle lib = Dart_LoadScript(url, source, LibraryTagHandler, import_map); |
111 DART_CHECK_VALID(lib); | 111 DART_CHECK_VALID(lib); |
112 Dart_Handle result = Dart_SetNativeResolver(lib, resolver); | 112 Dart_Handle result = Dart_SetNativeResolver(lib, resolver); |
113 DART_CHECK_VALID(result); | 113 DART_CHECK_VALID(result); |
114 return lib; | 114 return lib; |
115 } | 115 } |
116 | 116 |
117 | 117 |
118 Dart_Handle TestCase::lib() { | 118 Dart_Handle TestCase::lib() { |
119 Dart_Handle url = Dart_NewString(TestCase::url()); | 119 Dart_Handle url = Dart_NewString(TestCase::url()); |
(...skipping 101 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
221 | 221 |
222 bool CompilerTest::TestCompileFunction(const Function& function) { | 222 bool CompilerTest::TestCompileFunction(const Function& function) { |
223 Isolate* isolate = Isolate::Current(); | 223 Isolate* isolate = Isolate::Current(); |
224 ASSERT(isolate != NULL); | 224 ASSERT(isolate != NULL); |
225 ASSERT(ClassFinalizer::AllClassesFinalized()); | 225 ASSERT(ClassFinalizer::AllClassesFinalized()); |
226 const Error& error = Error::Handle(Compiler::CompileFunction(function)); | 226 const Error& error = Error::Handle(Compiler::CompileFunction(function)); |
227 return error.IsNull(); | 227 return error.IsNull(); |
228 } | 228 } |
229 | 229 |
230 } // namespace dart | 230 } // namespace dart |
OLD | NEW |