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

Unified Diff: Source/bindings/tests/results/core/V8TestInterface.cpp

Issue 810563007: IDL: Add missing type-check for callback function arguments (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 5 years, 11 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
« no previous file with comments | « Source/bindings/tests/idls/core/TestObject.idl ('k') | Source/bindings/tests/results/core/V8TestObject.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/bindings/tests/results/core/V8TestInterface.cpp
diff --git a/Source/bindings/tests/results/core/V8TestInterface.cpp b/Source/bindings/tests/results/core/V8TestInterface.cpp
index ee22dc2217f61d28880eb99c498d07257f850a05..ade3ea83602ed0079b3b9d934c4b88ce5ec9beb7 100644
--- a/Source/bindings/tests/results/core/V8TestInterface.cpp
+++ b/Source/bindings/tests/results/core/V8TestInterface.cpp
@@ -1540,6 +1540,10 @@ static void partialVoidMethodPartialCallbackTypeArgMethod(const v8::FunctionCall
TestInterfaceImplementation* impl = V8TestInterface::toImpl(info.Holder());
ScriptValue partialCallbackTypeArg;
{
+ if (!info[0]->IsFunction()) {
+ V8ThrowException::throwTypeError(info.GetIsolate(), ExceptionMessages::failedToExecute("partialVoidMethodPartialCallbackTypeArg", "TestInterface", "The callback provided as parameter 1 is not a function."));
+ return;
+ }
partialCallbackTypeArg = ScriptValue(ScriptState::current(info.GetIsolate()), info[0]);
}
TestPartialInterface::partialVoidMethodPartialCallbackTypeArg(*impl, partialCallbackTypeArg);
« no previous file with comments | « Source/bindings/tests/idls/core/TestObject.idl ('k') | Source/bindings/tests/results/core/V8TestObject.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698