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

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: 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..e88f7d6e886096afb513aec55721e9503e765ced 100644
--- a/src/json-stringifier.h
+++ b/src/json-stringifier.h
@@ -397,9 +397,9 @@ 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() && !object->IsJSGlobalProxy());
Benedikt Meurer 2015/12/02 07:43:38 Nit: Please turn into two separate CHECKs.
Yang 2015/12/02 08:00:43 Done.
+ 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