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

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

Issue 412443002: DevTools: Do not skip appending arguments in ScriptFunctionCall. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: addressed Created 6 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
« no previous file with comments | « Source/bindings/core/v8/ScriptFunctionCall.h ('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/ScriptFunctionCall.cpp
diff --git a/Source/bindings/core/v8/ScriptFunctionCall.cpp b/Source/bindings/core/v8/ScriptFunctionCall.cpp
index 4f4af8f0f0f174e5af1483b8de97f91eab205e2e..030494b23c1d765d259a2acb68b41bfe1227d8aa 100644
--- a/Source/bindings/core/v8/ScriptFunctionCall.cpp
+++ b/Source/bindings/core/v8/ScriptFunctionCall.cpp
@@ -45,7 +45,7 @@ namespace blink {
void ScriptCallArgumentHandler::appendArgument(const ScriptValue& argument)
{
if (argument.scriptState() != m_scriptState) {
- ASSERT_NOT_REACHED();
+ appendUndefinedArgument();
return;
}
m_arguments.append(argument);
@@ -111,11 +111,21 @@ void ScriptCallArgumentHandler::appendArgument(const Vector<ScriptValue>& argume
v8::Isolate* isolate = m_scriptState->isolate();
ScriptState::Scope scope(m_scriptState.get());
v8::Handle<v8::Array> result = v8::Array::New(isolate, argument.size());
- for (size_t i = 0; i < argument.size(); ++i)
- result->Set(v8::Integer::New(isolate, i), argument[i].v8Value());
+ for (size_t i = 0; i < argument.size(); ++i) {
+ if (argument[i].scriptState() != m_scriptState)
+ result->Set(v8::Integer::New(isolate, i), v8::Undefined(isolate));
+ else
+ result->Set(v8::Integer::New(isolate, i), argument[i].v8Value());
+ }
m_arguments.append(ScriptValue(m_scriptState.get(), result));
}
+void ScriptCallArgumentHandler::appendUndefinedArgument()
+{
+ v8::Isolate* isolate = m_scriptState->isolate();
+ m_arguments.append(ScriptValue(m_scriptState.get(), v8::Undefined(isolate)));
+}
+
ScriptFunctionCall::ScriptFunctionCall(const ScriptValue& thisObject, const String& name)
: ScriptCallArgumentHandler(thisObject.scriptState())
, m_thisObject(thisObject)
« no previous file with comments | « Source/bindings/core/v8/ScriptFunctionCall.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698