Index: runtime/vm/unit_test.cc |
=================================================================== |
--- runtime/vm/unit_test.cc (revision 3821) |
+++ runtime/vm/unit_test.cc (working copy) |
@@ -186,18 +186,38 @@ |
bool CompilerTest::TestCompileScript(const Library& library, |
const Script& script) { |
+ bool retval; |
Isolate* isolate = Isolate::Current(); |
ASSERT(isolate != NULL); |
- const Error& error = Error::Handle(Compiler::Compile(library, script)); |
- return error.IsNull(); |
+ LongJump* base = isolate->long_jump_base(); |
+ LongJump jump; |
+ isolate->set_long_jump_base(&jump); |
+ if (setjmp(*jump.Set()) == 0) { |
+ Compiler::Compile(library, script); |
+ retval = true; |
+ } else { |
+ retval = false; |
+ } |
+ isolate->set_long_jump_base(base); |
+ return retval; |
} |
bool CompilerTest::TestCompileFunction(const Function& function) { |
+ bool retval; |
Isolate* isolate = Isolate::Current(); |
ASSERT(isolate != NULL); |
- const Error& error = Error::Handle(Compiler::CompileFunction(function)); |
- return error.IsNull(); |
+ LongJump* base = isolate->long_jump_base(); |
+ LongJump jump; |
+ isolate->set_long_jump_base(&jump); |
+ if (setjmp(*jump.Set()) == 0) { |
+ Compiler::CompileFunction(function); |
+ retval = true; |
+ } else { |
+ retval = false; |
+ } |
+ isolate->set_long_jump_base(base); |
+ return retval; |
} |
} // namespace dart |