Commit 6a4762ec authored by Yuki Shiino's avatar Yuki Shiino Committed by Commit Bot

v8binding: Allow to throw stackoverflow in ScriptForbiddenScope.

Allows to throw a stackoverflow exception in ScriptForbiddenScope.

Bug: 813493
Change-Id: I75ebd44533b559369032fc750140bb22cb0c272a
Reviewed-on: https://chromium-review.googlesource.com/980013Reviewed-by: default avatarKentaro Hara <haraken@chromium.org>
Commit-Queue: Yuki Shiino <yukishiino@chromium.org>
Cr-Commit-Position: refs/heads/master@{#545765}
parent 17fe92fa
...@@ -89,12 +89,15 @@ v8::Local<v8::Value> ThrowStackOverflowExceptionIfNeeded(v8::Isolate* isolate) { ...@@ -89,12 +89,15 @@ v8::Local<v8::Value> ThrowStackOverflowExceptionIfNeeded(v8::Isolate* isolate) {
v8::MicrotasksScope microtasks_scope( v8::MicrotasksScope microtasks_scope(
isolate, v8::MicrotasksScope::kDoNotRunMicrotasks); isolate, v8::MicrotasksScope::kDoNotRunMicrotasks);
V8PerIsolateData::From(isolate)->SetIsHandlingRecursionLevelError(true); V8PerIsolateData::From(isolate)->SetIsHandlingRecursionLevelError(true);
ScriptForbiddenScope::AllowUserAgentScript allow_script;
v8::Local<v8::Value> result = v8::Local<v8::Value> result =
v8::Function::New(isolate->GetCurrentContext(), v8::Function::New(isolate->GetCurrentContext(),
ThrowStackOverflowException, v8::Local<v8::Value>(), 0, ThrowStackOverflowException, v8::Local<v8::Value>(), 0,
v8::ConstructorBehavior::kThrow) v8::ConstructorBehavior::kThrow)
.ToLocalChecked() .ToLocalChecked()
->Call(v8::Undefined(isolate), 0, nullptr); ->Call(v8::Undefined(isolate), 0, nullptr);
V8PerIsolateData::From(isolate)->SetIsHandlingRecursionLevelError(false); V8PerIsolateData::From(isolate)->SetIsHandlingRecursionLevelError(false);
return result; return result;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment