Reviewers: Mads Ager, Description: Removed a few calls to Top::ReportPendingMessages() that caused the messages to be reported prematurely and not at the C++/JS boundary.
Please review this at http://codereview.chromium.org/13287 SVN Base: http://v8.googlecode.com/svn/branches/bleeding_edge/ Affected files: M src/compiler.cc M test/cctest/test-api.cc Index: test/cctest/test-api.cc =================================================================== --- test/cctest/test-api.cc (revision 945) +++ test/cctest/test-api.cc (working copy) @@ -1810,6 +1810,21 @@ } +THREADED_TEST(EvalInTryFinally) { + v8::HandleScope scope; + LocalContext context; + v8::TryCatch try_catch; + CompileRun("(function() {" + " try {" + " eval('asldkf (*&^&*^');" + " } finally {" + " return;" + " }" + "})()"); + CHECK(!try_catch.HasCaught()); +} + + // This test works by making a stack of alternating JavaScript and C // activations. These activations set up exception handlers with regular // intervals, one interval for C activations and another for JavaScript Index: src/compiler.cc =================================================================== --- src/compiler.cc (revision 944) +++ src/compiler.cc (working copy) @@ -101,7 +101,6 @@ // Check for parse errors. if (lit == NULL) { ASSERT(Top::has_pending_exception()); - Top::ReportPendingMessages(); return Handle<JSFunction>::null(); } @@ -119,7 +118,6 @@ // Check for stack-overflow exceptions. if (code.is_null()) { Top::StackOverflow(); - Top::ReportPendingMessages(); return Handle<JSFunction>::null(); } @@ -208,6 +206,8 @@ } } + if (result.is_null()) Top::ReportPendingMessages(); + return result; } @@ -272,7 +272,6 @@ // Check for parse errors. if (lit == NULL) { ASSERT(Top::has_pending_exception()); - Top::ReportPendingMessages(); return false; } @@ -290,7 +289,6 @@ // Check for stack-overflow exception. if (code.is_null()) { Top::StackOverflow(); - Top::ReportPendingMessages(); return false; } --~--~---------~--~----~------------~-------~--~----~ v8-dev mailing list [email protected] http://groups.google.com/group/v8-dev -~----------~----~----~----~------~----~------~--~---
