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 209 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
220 node_sequence_->scope()->AddVariable(temp); | 220 node_sequence_->scope()->AddVariable(temp); |
221 return temp; | 221 return temp; |
222 } | 222 } |
223 | 223 |
224 | 224 |
225 bool CompilerTest::TestCompileScript(const Library& library, | 225 bool CompilerTest::TestCompileScript(const Library& library, |
226 const Script& script) { | 226 const Script& script) { |
227 Isolate* isolate = Isolate::Current(); | 227 Isolate* isolate = Isolate::Current(); |
228 ASSERT(isolate != NULL); | 228 ASSERT(isolate != NULL); |
229 const Error& error = Error::Handle(Compiler::Compile(library, script)); | 229 const Error& error = Error::Handle(Compiler::Compile(library, script)); |
| 230 if (!error.IsNull()) { |
| 231 OS::Print("Error compiling test script:\n%s\n", |
| 232 error.ToErrorCString()); |
| 233 } |
230 return error.IsNull(); | 234 return error.IsNull(); |
231 } | 235 } |
232 | 236 |
233 | 237 |
234 bool CompilerTest::TestCompileFunction(const Function& function) { | 238 bool CompilerTest::TestCompileFunction(const Function& function) { |
235 Isolate* isolate = Isolate::Current(); | 239 Isolate* isolate = Isolate::Current(); |
236 ASSERT(isolate != NULL); | 240 ASSERT(isolate != NULL); |
237 ASSERT(ClassFinalizer::AllClassesFinalized()); | 241 ASSERT(ClassFinalizer::AllClassesFinalized()); |
238 const Error& error = Error::Handle(Compiler::CompileFunction(function)); | 242 const Error& error = Error::Handle(Compiler::CompileFunction(function)); |
239 return error.IsNull(); | 243 return error.IsNull(); |
240 } | 244 } |
241 | 245 |
242 #endif // !defined(TARGET_ARCH_ARM64) | 246 #endif // !defined(TARGET_ARCH_ARM64) |
243 | 247 |
244 } // namespace dart | 248 } // namespace dart |
OLD | NEW |