Commit ce5e9b02 authored by yangguo@chromium.org's avatar yangguo@chromium.org

Go to slow path when JSON.stringifying the global proxy.

R=verwaest@chromium.org

Review URL: https://codereview.chromium.org/396993004

git-svn-id: https://v8.googlecode.com/svn/branches/bleeding_edge@22440 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
parent 509faa85
......@@ -442,7 +442,8 @@ BasicJsonStringifier::Result BasicJsonStringifier::Serialize_(
SerializeString(Handle<String>::cast(object));
return SUCCESS;
} else if (object->IsJSObject()) {
if (object->IsAccessCheckNeeded()) break;
// Go to slow path for global proxy and objects requiring access checks.
if (object->IsAccessCheckNeeded() || object->IsJSGlobalProxy()) break;
if (deferred_string_key) SerializeDeferredKey(comma, key);
return SerializeJSObject(Handle<JSObject>::cast(object));
}
......@@ -630,11 +631,7 @@ BasicJsonStringifier::Result BasicJsonStringifier::SerializeJSObject(
HandleScope handle_scope(isolate_);
Result stack_push = StackPush(object);
if (stack_push != SUCCESS) return stack_push;
if (object->IsJSGlobalProxy()) {
object = Handle<JSObject>(
JSObject::cast(object->GetPrototype()), isolate_);
ASSERT(object->IsGlobalObject());
}
ASSERT(!object->IsJSGlobalProxy() && !object->IsGlobalObject());
Append('{');
bool comma = false;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment