Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(616)

Unified Diff: src/execution.cc

Issue 203223013: Introduce API to trigger exception on JS execution. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: addressed comment Created 6 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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);
« include/v8.h ('K') | « src/assert-scope.h ('k') | test/cctest/test-api.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698