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

Unified Diff: third_party/WebKit/Source/bindings/templates/callback_function.cpp

Issue 2350813005: bindings: Support sequence in callback function arguments (Closed)
Patch Set: Pass ExceptionState Created 4 years, 3 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: third_party/WebKit/Source/bindings/templates/callback_function.cpp
diff --git a/third_party/WebKit/Source/bindings/templates/callback_function.cpp b/third_party/WebKit/Source/bindings/templates/callback_function.cpp
index d0c68a56e4c0349e5fbcb8933605e1dc465bcdca..f278da56b90f5dde6ed2da641ca4e450f2e2c8c7 100644
--- a/third_party/WebKit/Source/bindings/templates/callback_function.cpp
+++ b/third_party/WebKit/Source/bindings/templates/callback_function.cpp
@@ -29,6 +29,7 @@ bool {{v8_class}}::call({{argument_declarations | join(', ')}})
if (m_callback.isEmpty())
return false;
+
ScriptState::Scope scope(scriptState);
{% for argument in arguments %}
@@ -43,8 +44,6 @@ bool {{v8_class}}::call({{argument_declarations | join(', ')}})
v8::Local<v8::Value> v8ReturnValue;
v8::TryCatch exceptionCatcher(scriptState->isolate());
- exceptionCatcher.SetVerbose(true);
bashi 2016/09/23 01:47:10 Removed SetVerbose(true) call because the testharn
haraken 2016/09/23 01:50:34 Hmm, this might be problematic. SetVerbose(true)
bashi 2016/09/23 01:58:32 What's a solution then? Also, why don't we always
-
if (V8ScriptRunner::callFunction(m_callback.newLocal(scriptState->isolate()), scriptState->getExecutionContext(), scriptState->context()->Global(), {{arguments | length}}, argv, scriptState->isolate()).ToLocal(&v8ReturnValue))
{
{% if return_value %}
@@ -53,6 +52,8 @@ bool {{v8_class}}::call({{argument_declarations | join(', ')}})
{% endif %}
return true;
}
+ DCHECK(exceptionCatcher.HasCaught());
+ exceptionState.rethrowV8Exception(exceptionCatcher.Exception());
return false;
}

Powered by Google App Engine
This is Rietveld 408576698