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

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

Issue 13575004: Apply script preprocessor to Web page scripts only. (Closed) Base URL: https://chromium.googlesource.com/external/WebKit_trimmed.git@master
Patch Set: respond to review Created 7 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: Source/bindings/v8/V8LazyEventListener.cpp
diff --git a/Source/bindings/v8/V8LazyEventListener.cpp b/Source/bindings/v8/V8LazyEventListener.cpp
index f706d31485fe2fa2b51a67a038b788ad050e8cc5..d255c6166961a06f5ffef9b874028560e7edd88c 100644
--- a/Source/bindings/v8/V8LazyEventListener.cpp
+++ b/Source/bindings/v8/V8LazyEventListener.cpp
@@ -135,6 +135,7 @@ void V8LazyEventListener::prepareListenerObject(ScriptExecutionContext* context)
return;
v8::Context::Scope scope(v8Context);
+ String listenerSource = frame->script()->preprocess(m_code, m_functionName);
// FIXME: Remove the following 'with' hack.
//
@@ -158,7 +159,7 @@ void V8LazyEventListener::prepareListenerObject(ScriptExecutionContext* context)
"with (this[1]) {"
"with (this[0]) {"
"return function(" + m_eventParameterName + ") {" +
- m_code + "\n" // Insert '\n' otherwise //-style comments could break the handler.
+ listenerSource + "\n" // Insert '\n' otherwise //-style comments could break the handler.
"};"
"}}}})";

Powered by Google App Engine
This is Rietveld 408576698