Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(257)

Unified Diff: runtime/vm/unit_test.cc

Issue 9316071: Dart_PropagateError, take 2. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 8 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « runtime/vm/unit_test.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/unit_test.cc
===================================================================
--- runtime/vm/unit_test.cc (revision 3862)
+++ runtime/vm/unit_test.cc (working copy)
@@ -186,38 +186,18 @@
bool CompilerTest::TestCompileScript(const Library& library,
const Script& script) {
- bool retval;
Isolate* isolate = Isolate::Current();
ASSERT(isolate != NULL);
- 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;
+ const Error& error = Error::Handle(Compiler::Compile(library, script));
+ return error.IsNull();
}
bool CompilerTest::TestCompileFunction(const Function& function) {
- bool retval;
Isolate* isolate = Isolate::Current();
ASSERT(isolate != NULL);
- 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;
+ const Error& error = Error::Handle(Compiler::CompileFunction(function));
+ return error.IsNull();
}
} // namespace dart
« no previous file with comments | « runtime/vm/unit_test.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698