| Index: Source/bindings/core/v8/ScriptValue.cpp
|
| diff --git a/Source/bindings/core/v8/ScriptValue.cpp b/Source/bindings/core/v8/ScriptValue.cpp
|
| index 0371f67bad8694b2590b9413eea650bd6309864b..94716750ebaa06dda614e3cc44af42ef0b0f1283 100644
|
| --- a/Source/bindings/core/v8/ScriptValue.cpp
|
| +++ b/Source/bindings/core/v8/ScriptValue.cpp
|
| @@ -32,6 +32,7 @@
|
| #include "bindings/core/v8/ScriptValue.h"
|
|
|
| #include "bindings/core/v8/ScriptState.h"
|
| +#include "bindings/core/v8/SerializedScriptValueFactory.h"
|
| #include "bindings/core/v8/V8Binding.h"
|
| #include "platform/JSONValues.h"
|
|
|
| @@ -61,6 +62,20 @@ v8::Local<v8::Value> ScriptValue::v8ValueUnsafe() const
|
| return m_value->newLocal(isolate());
|
| }
|
|
|
| +v8::Local<v8::Value> ScriptValue::v8ValueFor(ScriptState* targetScriptState)
|
| +{
|
| + if (isEmpty())
|
| + return v8::Local<v8::Value>();
|
| + v8::Isolate* isolate = targetScriptState->isolate();
|
| + if (&m_scriptState->world() == &targetScriptState->world())
|
| + return m_value->newLocal(isolate);
|
| +
|
| + ASSERT(isolate->InContext());
|
| + v8::Local<v8::Value> value = m_value->newLocal(isolate);
|
| + RefPtr<SerializedScriptValue> serialized = SerializedScriptValueFactory::instance().createAndSwallowExceptions(isolate, value);
|
| + return serialized->deserialize();
|
| +}
|
| +
|
| bool ScriptValue::toString(String& result) const
|
| {
|
| if (isEmpty())
|
|
|