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

Unified Diff: src/harmony-tostring.js

Issue 895633004: Update harmony Object.prototype.toString to 2/2/2015 spec (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 5 years, 11 months 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/array-tostring.js » ('j') | test/mjsunit/es6/object-tostring.js » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/harmony-tostring.js
diff --git a/src/harmony-tostring.js b/src/harmony-tostring.js
index a5d892c8e23af6ce90accaff70320114eae844e9..aed8ca03997120f266d6545f6f589759ac7796b0 100644
--- a/src/harmony-tostring.js
+++ b/src/harmony-tostring.js
@@ -9,19 +9,6 @@
// var $Object = global.Object;
// var $Symbol = global.Symbol;
-var kBuiltinStringTags = {
- "__proto__": null,
- "Arguments": true,
- "Array": true,
- "Boolean": true,
- "Date": true,
- "Error": true,
- "Function": true,
- "Number": true,
- "RegExp": true,
- "String": true
-};
-
DefaultObjectToString = ObjectToStringHarmony;
// ES6 draft 08-24-14, section 19.1.3.6
function ObjectToStringHarmony() {
@@ -30,12 +17,8 @@ function ObjectToStringHarmony() {
var O = ToObject(this);
var builtinTag = %_ClassOf(O);
var tag = O[symbolToStringTag];
- if (IS_UNDEFINED(tag)) {
+ if (!IS_STRING(tag)) {
tag = builtinTag;
- } else if (!IS_STRING(tag)) {
- return "[object ???]";
- } else if (tag !== builtinTag && kBuiltinStringTags[tag]) {
- return "[object ~" + tag + "]";
}
return "[object " + tag + "]";
}
« no previous file with comments | « no previous file | test/mjsunit/es6/array-tostring.js » ('j') | test/mjsunit/es6/object-tostring.js » ('J')

Powered by Google App Engine
This is Rietveld 408576698