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

Issue 2071343002: Fix Object.prototype.toString() when @@toStringTag is not a string. (Closed)

Created:
4 years, 6 months ago by Franzi
Modified:
4 years, 6 months ago
CC:
v8-reviews_googlegroups.com
Base URL:
https://chromium.googlesource.com/v8/v8.git@master
Target Ref:
refs/pending/heads/master
Project:
v8
Visibility:
Public.

Description

Fix Object.prototype.toString() when @@toStringTag is not a string. ES2017 draft 19.1.3.6: If @@toStringTag is not a string, Object.prototype.toString() returns [object Object], except in the following cases: - Array - String - Arguments - Function - Error - Boolean - Number - Date - RegExp. For anything else, e.g., Maps, Sets, TypedArrays, or the global object, toString() returns [object Object] if @@toStringTag is absent or not a string. In order to be able to easily identify the global object in d8, we set @@toStringTag to "global" for d8. CQ_INCLUDE_TRYBOTS=tryserver.chromium.linux:linux_chromium_rel_ng;tryserver.blink:linux_blink_rel BUG= Committed: https://crrev.com/bdc78957e55ef2062bfdf59c29cbe45f50df2d3b Cr-Commit-Position: refs/heads/master@{#37218}

Patch Set 1 #

Patch Set 2 : Fix toString() method on typed arrays #

Patch Set 3 : Rebase #

Patch Set 4 : Remove empty lines #

Patch Set 5 : Remove double lines about Generator case #

Patch Set 6 : Switch over instance types rather then overwriting tag value #

Patch Set 7 : Whitelist; Global object return [object Object] now #

Patch Set 8 : Fix toString() of global object for d8 #

Patch Set 9 : Fix tests for toString() of global object #

Patch Set 10 : Rebase and add comment back in #

Patch Set 11 : Add test for global object #

Unified diffs Side-by-side diffs Delta from patch set Stats (+90 lines, -15 lines) Patch
M src/d8.cc View 1 2 3 4 5 6 7 1 chunk +4 lines, -0 lines 0 comments Download
M src/objects.cc View 1 2 3 4 5 6 7 8 9 10 2 chunks +18 lines, -1 line 0 comments Download
M test/cctest/test-api.cc View 1 2 3 4 5 6 7 8 9 2 chunks +2 lines, -2 lines 0 comments Download
M test/mjsunit/es6/object-tostring.js View 1 2 3 4 5 6 7 8 9 10 3 chunks +66 lines, -12 lines 0 comments Download

Dependent Patchsets:

Messages

Total messages: 20 (10 generated)
Franzi
Hi, I was refactoring Object.prototype.toString() to use the instance type instead of class_name(). I think ...
4 years, 6 months ago (2016-06-20 09:57:23 UTC) #4
Toon Verwaest
Good catch. Seems like builtinStringTag should just support the types listed between step 4 and ...
4 years, 6 months ago (2016-06-20 14:39:45 UTC) #5
caitp (gmail)
On 2016/06/20 14:39:45, Toon Verwaest wrote: > Good catch. > Seems like builtinStringTag should just ...
4 years, 6 months ago (2016-06-20 15:04:11 UTC) #6
Franzi
On 2016/06/20 14:39:45, Toon Verwaest wrote: > Good catch. > Seems like builtinStringTag should just ...
4 years, 6 months ago (2016-06-21 09:02:02 UTC) #8
Toon Verwaest
What I meant was doing the opposite: only return non-Object if it's one of the ...
4 years, 6 months ago (2016-06-21 13:10:53 UTC) #9
Franzi
Hi, I changed the blacklist to a whitelist and fixed the global object case. Please ...
4 years, 6 months ago (2016-06-23 11:47:14 UTC) #13
Toon Verwaest
lgtm
4 years, 6 months ago (2016-06-23 12:00:40 UTC) #14
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/2071343002/200001
4 years, 6 months ago (2016-06-23 12:14:32 UTC) #16
commit-bot: I haz the power
Committed patchset #11 (id:200001)
4 years, 6 months ago (2016-06-23 13:37:47 UTC) #18
commit-bot: I haz the power
4 years, 6 months ago (2016-06-23 13:40:14 UTC) #20
Message was sent while issue was closed.
Patchset 11 (id:??) landed as
https://crrev.com/bdc78957e55ef2062bfdf59c29cbe45f50df2d3b
Cr-Commit-Position: refs/heads/master@{#37218}

Powered by Google App Engine
This is Rietveld 408576698