Revision: 3365
Author: [email protected]
Date: Wed Nov 25 09:06:33 2009
Log: Merge bleeding_edge revision 3364 to the 1.3 branch.

Do not force fatal error when getting exception during extension
installation.

Review URL: http://codereview.chromium.org/432023
http://code.google.com/p/v8/source/detail?r=3365

Modified:
  /branches/1.3/src/bootstrapper.cc
  /branches/1.3/src/version.cc
  /branches/1.3/test/cctest/test-api.cc

=======================================
--- /branches/1.3/src/bootstrapper.cc   Wed Oct 28 07:53:37 2009
+++ /branches/1.3/src/bootstrapper.cc   Wed Nov 25 09:06:33 2009
@@ -1302,8 +1302,6 @@
    ASSERT(Top::has_pending_exception() != result);
    if (!result) {
      Top::clear_pending_exception();
-    v8::Utils::ReportApiFailure(
-        "v8::Context::New()", "Error installing extension");
    }
    current->set_state(v8::INSTALLED);
    return result;
=======================================
--- /branches/1.3/src/version.cc        Wed Nov 18 03:44:39 2009
+++ /branches/1.3/src/version.cc        Wed Nov 25 09:06:33 2009
@@ -35,7 +35,7 @@
  #define MAJOR_VERSION     1
  #define MINOR_VERSION     3
  #define BUILD_NUMBER      18
-#define PATCH_LEVEL       12
+#define PATCH_LEVEL       13
  #define CANDIDATE_VERSION false

  // Define SONAME to have the SCons build the put a specific SONAME into the
=======================================
--- /branches/1.3/test/cctest/test-api.cc       Wed Nov 18 03:44:39 2009
+++ /branches/1.3/test/cctest/test-api.cc       Wed Nov 25 09:06:33 2009
@@ -2904,6 +2904,40 @@
    v8::Handle<Value> result = Script::Compile(v8_str("Foo()"))->Run();
    CHECK_EQ(result, v8::Integer::New(4));
  }
+
+
+static const char* kSyntaxErrorInExtensionSource =
+    "[";
+
+
+// Test that a syntax error in an extension does not cause a fatal
+// error but results in an empty context.
+THREADED_TEST(SyntaxErrorExtensions) {
+  v8::HandleScope handle_scope;
+  v8::RegisterExtension(new Extension("syntaxerror",
+                                      kSyntaxErrorInExtensionSource));
+  const char* extension_names[] = { "syntaxerror" };
+  v8::ExtensionConfiguration extensions(1, extension_names);
+  v8::Handle<Context> context = Context::New(&extensions);
+  CHECK(context.IsEmpty());
+}
+
+
+static const char* kExceptionInExtensionSource =
+    "throw 42";
+
+
+// Test that an exception when installing an extension does not cause
+// a fatal error but results in an empty context.
+THREADED_TEST(ExceptionExtensions) {
+  v8::HandleScope handle_scope;
+  v8::RegisterExtension(new Extension("exception",
+                                      kExceptionInExtensionSource));
+  const char* extension_names[] = { "exception" };
+  v8::ExtensionConfiguration extensions(1, extension_names);
+  v8::Handle<Context> context = Context::New(&extensions);
+  CHECK(context.IsEmpty());
+}


  static void CheckDependencies(const char* name, const char* expected) {

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

Reply via email to