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

Unified Diff: Source/bindings/scripts/deprecated_code_generator_v8.pm

Issue 22687002: Treat non-callable input as null for EventHandler attributes (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Take arv'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/scripts/deprecated_code_generator_v8.pm
diff --git a/Source/bindings/scripts/deprecated_code_generator_v8.pm b/Source/bindings/scripts/deprecated_code_generator_v8.pm
index ce077eefbe1f6408512706df8333bc54ee016185..65f721b924d2848c8709f84a183d08cd68c92cb9 100644
--- a/Source/bindings/scripts/deprecated_code_generator_v8.pm
+++ b/Source/bindings/scripts/deprecated_code_generator_v8.pm
@@ -1852,6 +1852,9 @@ END
if ($attribute->type eq "EventHandler") {
my $implSetterFunctionName = FirstLetterToUpperCase($attrName);
AddToImplIncludes("bindings/v8/V8AbstractEventListener.h");
+ # Non callable input should be treated as null
+ $code .= " if (!value->IsNull() && !value->IsFunction())\n";
+ $code .= " value = v8::Null(info.GetIsolate());\n";
if (!InheritsInterface($interface, "Node")) {
my $attrImplName = GetImplName($attribute);
$code .= " transferHiddenDependency(info.Holder(), imp->${attrImplName}(isolatedWorldForIsolate(info.GetIsolate())), value, ${v8ClassName}::eventListenerCacheIndex, info.GetIsolate());\n";

Powered by Google App Engine
This is Rietveld 408576698