Index: src/execution.cc |
diff --git a/src/execution.cc b/src/execution.cc |
index bef01a2a91ca47331eb7ff7236795cf12cd658b0..924814cff46cb4257e185eac1c78734eb1b1c884 100644 |
--- a/src/execution.cc |
+++ b/src/execution.cc |
@@ -78,6 +78,12 @@ static Handle<Object> Invoke(bool is_construct, |
// Entering JavaScript. |
VMState<JS> state(isolate); |
CHECK(AllowJavascriptExecution::IsAllowed(isolate)); |
+ if (!ThrowOnJavascriptExecution::IsAllowed(isolate)) { |
+ isolate->ThrowIllegalOperation(); |
+ *has_pending_exception = true; |
+ isolate->ReportPendingMessages(); |
+ return Handle<Object>(); |
+ } |
// Placeholder for return value. |
MaybeObject* value = reinterpret_cast<Object*>(kZapValue); |