Removed a few calls to Top::ReportPendingMessages() that caused the messages to be...
authorolehougaard <olehougaard@ce2b1a6d-e550-0410-aec6-3dcde31c8c00>
Tue, 9 Dec 2008 13:18:33 +0000 (13:18 +0000)
committerolehougaard <olehougaard@ce2b1a6d-e550-0410-aec6-3dcde31c8c00>
Tue, 9 Dec 2008 13:18:33 +0000 (13:18 +0000)
Review URL: http://codereview.chromium.org/13287

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@954 ce2b1a6d-e550-0410-aec6-3dcde31c8c00

src/compiler.cc
test/cctest/test-api.cc

index 1c3eeb226cf50338f40f74d795fdb26a4c4a3f8f..81be930fc50edce88b33d975546c54749e569bb0 100644 (file)
@@ -101,7 +101,6 @@ static Handle<JSFunction> MakeFunction(bool is_global,
   // Check for parse errors.
   if (lit == NULL) {
     ASSERT(Top::has_pending_exception());
-    Top::ReportPendingMessages();
     return Handle<JSFunction>::null();
   }
 
@@ -119,7 +118,6 @@ static Handle<JSFunction> MakeFunction(bool is_global,
   // Check for stack-overflow exceptions.
   if (code.is_null()) {
     Top::StackOverflow();
-    Top::ReportPendingMessages();
     return Handle<JSFunction>::null();
   }
 
@@ -208,6 +206,8 @@ Handle<JSFunction> Compiler::Compile(Handle<String> source,
     }
   }
 
+  if (result.is_null()) Top::ReportPendingMessages();
+
   return result;
 }
 
@@ -272,7 +272,6 @@ bool Compiler::CompileLazy(Handle<SharedFunctionInfo> shared,
   // Check for parse errors.
   if (lit == NULL) {
     ASSERT(Top::has_pending_exception());
-    Top::ReportPendingMessages();
     return false;
   }
 
@@ -290,7 +289,6 @@ bool Compiler::CompileLazy(Handle<SharedFunctionInfo> shared,
   // Check for stack-overflow exception.
   if (code.is_null()) {
     Top::StackOverflow();
-    Top::ReportPendingMessages();
     return false;
   }
 
index 7e1d464ad24a001cfb7eae13df37f828498235bf..c930a1efc8ee02a8b2b1733645865894849c99ab 100644 (file)
@@ -1810,6 +1810,21 @@ v8::Handle<Value> JSCheck(const v8::Arguments& args) {
 }
 
 
+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