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

Unified Diff: Source/bindings/v8/V8EventListener.cpp

Issue 22687002: Treat non-callable input as null for EventHandler attributes (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Take Kentaro's feedback into consideration Created 7 years, 4 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: Source/bindings/v8/V8EventListener.cpp
diff --git a/Source/bindings/v8/V8EventListener.cpp b/Source/bindings/v8/V8EventListener.cpp
index 8ada755b27a3e233f0a5002bafcd30e3ec8f75f2..9a0751f2ae6b993065d9904420340aeebdd1ea90 100644
--- a/Source/bindings/v8/V8EventListener.cpp
+++ b/Source/bindings/v8/V8EventListener.cpp
@@ -55,6 +55,8 @@ v8::Local<v8::Function> V8EventListener::getListenerFunction(ScriptExecutionCont
return v8::Local<v8::Function>::Cast(listener);
if (listener->IsObject()) {
+ // EventHandler attributes should only accept JS Functions as input.
+ ASSERT(!isAttribute());
arv (Not doing code reviews) 2013/08/08 14:41:28 Maybe use ASSERT_WITH_MESSAGE?
v8::Local<v8::Value> property = listener->Get(v8::String::NewSymbol("handleEvent"));
// Check that no exceptions were thrown when getting the
// handleEvent property and that the value is a function.

Powered by Google App Engine
This is Rietveld 408576698