Reviewers: Mads Ager,

Description:
Added reporting compilation errors.

Please review this at http://codereview.chromium.org/13125

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 915)
+++ test/cctest/test-api.cc     (working copy)
@@ -3008,6 +3008,16 @@
  }


+TEST(CompilationErrorUsingTryCatchHandler) {
+  v8::HandleScope scope;
+  LocalContext env;
+  v8::TryCatch try_catch;
+  Script::Compile(v8_str("This doesn't &*&@#$&*^ compile."));
+  CHECK_NE(NULL, *try_catch.Exception());
+  CHECK(try_catch.HasCaught());
+}
+
+
  // SecurityHandler can't be run twice
  TEST(SecurityHandler) {
    v8::HandleScope scope0;
Index: src/compiler.cc
===================================================================
--- src/compiler.cc     (revision 915)
+++ src/compiler.cc     (working copy)
@@ -206,6 +206,10 @@
      }
    }

+  if (result.is_null()) {
+    Top::ReportPendingMessages();
+  }
+
    return result;
  }




--~--~---------~--~----~------------~-------~--~----~
v8-dev mailing list
[email protected]
http://groups.google.com/group/v8-dev
-~----------~----~----~----~------~----~------~--~---

Reply via email to