Chromium Code Reviews| 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..02742942d6fc1e0b27fa466852c53344e199eec9 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(); |
| + appendArgument(); |
|
yurys
2014/07/21 12:45:32
Looks like it should be done in a separate patch.
aandrey
2014/07/22 11:08:43
Done. Extracted to http://crrev.com/412443002
|
| 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::appendArgument() |
| +{ |
| + 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) |