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

Unified Diff: src/json-stringifier.h

Issue 1495473002: [es6] correctly handle object wrappers in JSON.stringify. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: rebase, add tests, address nit Created 5 years 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 | « no previous file | test/mjsunit/es6/symbols.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/json-stringifier.h
diff --git a/src/json-stringifier.h b/src/json-stringifier.h
index 8bcef34c79fb9b7e9ddd48e820e1b3594ae82617..c96f975c9e2ca03baf18d1ade4738a042f85b91c 100644
--- a/src/json-stringifier.h
+++ b/src/json-stringifier.h
@@ -397,9 +397,10 @@ BasicJsonStringifier::Result BasicJsonStringifier::SerializeJSValue(
DCHECK(value->IsBoolean());
builder_.AppendCString(value->IsTrue() ? "true" : "false");
} else {
- // Fail gracefully for special value wrappers.
- isolate_->ThrowIllegalOperation();
- return EXCEPTION;
+ // ES6 24.3.2.1 step 10.c, serialize as an ordinary JSObject.
+ CHECK(!object->IsAccessCheckNeeded());
+ CHECK(!object->IsJSGlobalProxy());
+ return SerializeJSObject(object);
}
return SUCCESS;
}
« no previous file with comments | « no previous file | test/mjsunit/es6/symbols.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698