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

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

Issue 24139004: Add toWebCoreString() / toWebCoreAtomicString() overloads taking a v8::String (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Fix bad if condition Created 7 years, 3 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 | « Source/bindings/v8/IDBBindingUtilities.cpp ('k') | Source/bindings/v8/ScriptPreprocessor.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/bindings/v8/ScriptEventListener.cpp
diff --git a/Source/bindings/v8/ScriptEventListener.cpp b/Source/bindings/v8/ScriptEventListener.cpp
index 035802ab42306b9ee6b50c8763b570c39c0830fd..feeef882e52de5534591aab507f077d6b0cfea99 100644
--- a/Source/bindings/v8/ScriptEventListener.cpp
+++ b/Source/bindings/v8/ScriptEventListener.cpp
@@ -98,7 +98,7 @@ String eventListenerHandlerBody(Document* document, EventListener* listener)
V8AbstractEventListener* v8Listener = static_cast<V8AbstractEventListener*>(listener);
v8::Handle<v8::Context> context = toV8Context(document, v8Listener->world());
v8::Context::Scope contextScope(context);
- v8::Handle<v8::Object> function = v8Listener->getListenerObject(document);
+ v8::Handle<v8::Value> function = v8Listener->getListenerObject(document);
if (function.IsEmpty())
return "";
@@ -147,8 +147,8 @@ bool eventListenerHandlerLocation(Document* document, EventListener* listener, S
v8::Handle<v8::Value> scriptIdValue = function->GetScriptId();
scriptId = toWebCoreStringWithUndefinedOrNullCheck(scriptIdValue);
v8::ScriptOrigin origin = function->GetScriptOrigin();
- if (origin.ResourceName()->IsString() && !origin.ResourceName().IsEmpty())
- sourceName = toWebCoreString(origin.ResourceName());
+ if (!origin.ResourceName().IsEmpty() && origin.ResourceName()->IsString())
+ sourceName = toWebCoreString(origin.ResourceName().As<v8::String>());
else
sourceName = "";
lineNumber = function->GetScriptLineNumber();
« no previous file with comments | « Source/bindings/v8/IDBBindingUtilities.cpp ('k') | Source/bindings/v8/ScriptPreprocessor.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698