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

Unified Diff: Source/bindings/core/v8/V8LazyEventListener.cpp

Issue 906193002: Turn a bunch of ASSERTs into graceful failures when compiling listeners (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: updates Created 5 years, 10 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 | « LayoutTests/security/lazy-event-listener-expected.txt ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/bindings/core/v8/V8LazyEventListener.cpp
diff --git a/Source/bindings/core/v8/V8LazyEventListener.cpp b/Source/bindings/core/v8/V8LazyEventListener.cpp
index fd8ee45989db8cca124171dffbd93e03d318cb06..1e4b11d74e758b39f3e49717e16d484d0fbc16d6 100644
--- a/Source/bindings/core/v8/V8LazyEventListener.cpp
+++ b/Source/bindings/core/v8/V8LazyEventListener.cpp
@@ -120,7 +120,10 @@ void V8LazyEventListener::prepareListenerObject(ExecutionContext* executionConte
if (!scriptState->contextIsValid())
return;
- if (executionContext->isDocument() && !toDocument(executionContext)->allowInlineEventHandlers(m_node, this, m_sourceURL, m_position.m_line)) {
+ if (!executionContext->isDocument())
+ return;
+
+ if (!toDocument(executionContext)->allowInlineEventHandlers(m_node, this, m_sourceURL, m_position.m_line)) {
clearListenerObject();
return;
}
@@ -128,8 +131,6 @@ void V8LazyEventListener::prepareListenerObject(ExecutionContext* executionConte
if (hasExistingListenerObject())
return;
- ASSERT(executionContext->isDocument());
-
ScriptState::Scope scope(scriptState);
String listenerSource = InspectorInstrumentation::preprocessEventListener(toDocument(executionContext)->frame(), m_code, m_sourceURL, m_functionName);
@@ -166,7 +167,8 @@ void V8LazyEventListener::prepareListenerObject(ExecutionContext* executionConte
return;
// Call the outer function to get the inner function.
- ASSERT(result->IsFunction());
+ if (!result->IsFunction())
+ return;
v8::Local<v8::Function> intermediateFunction = result.As<v8::Function>();
HTMLFormElement* formElement = 0;
« no previous file with comments | « LayoutTests/security/lazy-event-listener-expected.txt ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698