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

Unified Diff: third_party/WebKit/Source/bindings/core/v8/V8AbstractEventListener.h

Issue 2187503002: binding: Returns null if there is no valid event handler. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Updated the layout test expectation. Created 4 years, 5 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/core/v8/V8AbstractEventListener.h
diff --git a/third_party/WebKit/Source/bindings/core/v8/V8AbstractEventListener.h b/third_party/WebKit/Source/bindings/core/v8/V8AbstractEventListener.h
index d79f275d204581555d6660e4fc115b81ea2ba3f5..019b9e1d1215f5678c07919d683c4d77b71d0ba9 100644
--- a/third_party/WebKit/Source/bindings/core/v8/V8AbstractEventListener.h
+++ b/third_party/WebKit/Source/bindings/core/v8/V8AbstractEventListener.h
@@ -74,6 +74,12 @@ public:
void handleEvent(ExecutionContext*, Event*) final;
virtual void handleEvent(ScriptState*, Event*);
+ v8::Local<v8::Value> getListenerOrNull(v8::Isolate* isolate, ExecutionContext* executionContext)
+ {
+ v8::Local<v8::Object> listener = getListenerObject(executionContext);
+ return listener.IsEmpty() ? v8::Null(isolate).As<v8::Value>() : listener.As<v8::Value>();
+ }
+
// Returns the listener object, either a function or an object, or the empty
// handle if the user script is not compilable. No exception will be thrown
// even if the user script is not compilable.

Powered by Google App Engine
This is Rietveld 408576698