Index: test/cctest/test-api.cc |
diff --git a/test/cctest/test-api.cc b/test/cctest/test-api.cc |
index 74afab2c1b069e63d6ff40781f452f89f9c920b1..d8214e15b0a5197fe8282c9511606db55abba291 100644 |
--- a/test/cctest/test-api.cc |
+++ b/test/cctest/test-api.cc |
@@ -22399,7 +22399,8 @@ TEST(DisallowJavascriptExecutionScope) { |
LocalContext context; |
v8::Isolate* isolate = context->GetIsolate(); |
v8::HandleScope scope(isolate); |
- v8::Isolate::DisallowJavascriptExecutionScope no_js(isolate); |
+ v8::Isolate::DisallowJavascriptExecutionScope no_js( |
+ isolate, v8::Isolate::DisallowJavascriptExecutionScope::CRASH_ON_FAILURE); |
CompileRun("2+2"); |
} |
@@ -22408,8 +22409,23 @@ TEST(AllowJavascriptExecutionScope) { |
LocalContext context; |
v8::Isolate* isolate = context->GetIsolate(); |
v8::HandleScope scope(isolate); |
- v8::Isolate::DisallowJavascriptExecutionScope no_js(isolate); |
+ v8::Isolate::DisallowJavascriptExecutionScope no_js( |
+ isolate, v8::Isolate::DisallowJavascriptExecutionScope::CRASH_ON_FAILURE); |
+ v8::Isolate::DisallowJavascriptExecutionScope throw_js( |
+ isolate, v8::Isolate::DisallowJavascriptExecutionScope::THROW_ON_FAILURE); |
{ v8::Isolate::AllowJavascriptExecutionScope yes_js(isolate); |
CompileRun("1+1"); |
} |
} |
+ |
+ |
+TEST(ThrowOnJavascriptExecution) { |
+ LocalContext context; |
+ v8::Isolate* isolate = context->GetIsolate(); |
+ v8::HandleScope scope(isolate); |
+ v8::TryCatch try_catch; |
+ v8::Isolate::DisallowJavascriptExecutionScope throw_js( |
+ isolate, v8::Isolate::DisallowJavascriptExecutionScope::THROW_ON_FAILURE); |
+ CompileRun("1+1"); |
+ CHECK(try_catch.HasCaught()); |
+} |