Index: Source/bindings/v8/ScriptValue.cpp |
diff --git a/Source/bindings/v8/ScriptValue.cpp b/Source/bindings/v8/ScriptValue.cpp |
index dd41b0d1f010c32cf76c495ae4cc81504fe49c3b..b342697e1a64862b83b6e02b902417371b0f60f0 100644 |
--- a/Source/bindings/v8/ScriptValue.cpp |
+++ b/Source/bindings/v8/ScriptValue.cpp |
@@ -84,7 +84,7 @@ String ScriptValue::toString(ScriptState*) const |
return v8StringToWebCoreString<String>(string, DoNotExternalize); |
} |
-static PassRefPtr<JSONValue> v8ToJSONValue(v8::Handle<v8::Value> value, int maxDepth) |
+static PassRefPtr<JSONValue> v8ToJSONValue(v8::Handle<v8::Value> value, int maxDepth, v8::Isolate* isolate) |
{ |
if (value.IsEmpty()) { |
ASSERT_NOT_REACHED(); |
@@ -108,8 +108,8 @@ static PassRefPtr<JSONValue> v8ToJSONValue(v8::Handle<v8::Value> value, int maxD |
RefPtr<JSONArray> inspectorArray = JSONArray::create(); |
uint32_t length = array->Length(); |
for (uint32_t i = 0; i < length; i++) { |
- v8::Local<v8::Value> value = array->Get(v8::Int32::New(i)); |
- RefPtr<JSONValue> element = v8ToJSONValue(value, maxDepth); |
+ v8::Local<v8::Value> value = array->Get(v8::Int32::New(i, isolate)); |
+ RefPtr<JSONValue> element = v8ToJSONValue(value, maxDepth, isolate); |
if (!element) |
return 0; |
inspectorArray->pushValue(element); |
@@ -122,11 +122,11 @@ static PassRefPtr<JSONValue> v8ToJSONValue(v8::Handle<v8::Value> value, int maxD |
v8::Local<v8::Array> propertyNames = object->GetPropertyNames(); |
uint32_t length = propertyNames->Length(); |
for (uint32_t i = 0; i < length; i++) { |
- v8::Local<v8::Value> name = propertyNames->Get(v8::Int32::New(i)); |
+ v8::Local<v8::Value> name = propertyNames->Get(v8::Int32::New(i, isolate)); |
// FIXME(yurys): v8::Object should support GetOwnPropertyNames |
if (name->IsString() && !object->HasRealNamedProperty(v8::Handle<v8::String>::Cast(name))) |
continue; |
- RefPtr<JSONValue> propertyValue = v8ToJSONValue(object->Get(name), maxDepth); |
+ RefPtr<JSONValue> propertyValue = v8ToJSONValue(object->Get(name), maxDepth, isolate); |
if (!propertyValue) |
return 0; |
jsonObject->setValue(toWebCoreStringWithNullCheck(name), propertyValue); |
@@ -142,7 +142,7 @@ PassRefPtr<JSONValue> ScriptValue::toJSONValue(ScriptState* scriptState) const |
v8::HandleScope handleScope(scriptState->isolate()); |
// v8::Object::GetPropertyNames() expects current context to be not null. |
v8::Context::Scope contextScope(scriptState->context()); |
- return v8ToJSONValue(v8Value(), JSONValue::maxDepth); |
+ return v8ToJSONValue(v8Value(), JSONValue::maxDepth, scriptState->isolate()); |
} |
} // namespace WebCore |