DescriptionFix 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 #
Dependent Patchsets: Messages
Total messages: 20 (10 generated)
|