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

Unified Diff: third_party/WebKit/Source/bindings/tests/results/modules/V8TestInterface5.cpp

Issue 2607433002: bindings: Throw a TypeError when a given callback function isn't callable (Closed)
Patch Set: Created 4 years 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 | « third_party/WebKit/Source/bindings/tests/results/core/V8TestObject.cpp ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/Source/bindings/tests/results/modules/V8TestInterface5.cpp
diff --git a/third_party/WebKit/Source/bindings/tests/results/modules/V8TestInterface5.cpp b/third_party/WebKit/Source/bindings/tests/results/modules/V8TestInterface5.cpp
index 4e1c16ed956d018b0ba2bf360c979bb76d643d95..4e063d288c8ee728ed75fa7058ae0ffbc6c7a106 100644
--- a/third_party/WebKit/Source/bindings/tests/results/modules/V8TestInterface5.cpp
+++ b/third_party/WebKit/Source/bindings/tests/results/modules/V8TestInterface5.cpp
@@ -581,7 +581,7 @@ static void voidMethodVoidCallbackFunctionModulesArgMethod(const v8::FunctionCal
}
VoidCallbackFunctionModules* arg;
- if (!info[0]->IsFunction()) {
+ if (!info[0]->IsObject() || !v8::Local<v8::Object>::Cast(info[0])->IsCallable()) {
V8ThrowException::throwTypeError(info.GetIsolate(), ExceptionMessages::failedToExecute("voidMethodVoidCallbackFunctionModulesArg", "TestInterface5", "The callback provided as parameter 1 is not a function."));
return;
@@ -663,7 +663,7 @@ static void forEachMethod(const v8::FunctionCallbackInfo<v8::Value>& info) {
ScriptValue callback;
ScriptValue thisArg;
- if (!info[0]->IsFunction()) {
+ if (!info[0]->IsObject() || !v8::Local<v8::Object>::Cast(info[0])->IsCallable()) {
exceptionState.throwTypeError("The callback provided as parameter 1 is not a function.");
return;
« no previous file with comments | « third_party/WebKit/Source/bindings/tests/results/core/V8TestObject.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698