[Webkit-unassigned] [Bug 232724] New: Array.prototype.toLocaleString does not stringify undefined/null localization results
bugzilla-daemon at webkit.org
bugzilla-daemon at webkit.org
Thu Nov 4 13:24:51 PDT 2021
https://bugs.webkit.org/show_bug.cgi?id=232724
Bug ID: 232724
Summary: Array.prototype.toLocaleString does not stringify
undefined/null localization results
Product: WebKit
Version: WebKit Nightly Build
Hardware: Unspecified
OS: Unspecified
Status: NEW
Severity: Normal
Priority: P2
Component: JavaScriptCore
Assignee: webkit-unassigned at lists.webkit.org
Reporter: richard.gibson at gmail.com
The algorithm at https://tc39.es/ecma402/#sup-array.prototype.tolocalestring requires looking up a "toLocaleString" property on each non-undefined non-null element of the receiver array, invoking it as a method, and (absent an exception) passing the result through ToString. However, JSC appears to bypass ToString for undefined or null output from the toLocaleString method.
The following expression should evaluate to "undefined", but instead evaluates to "":
[{toLocaleString(){}}].toLocaleString()
The following expression should evaluate to "null", but instead evaluates to "":
[{toLocaleString(){return null}}].toLocaleString()
Also reported to test262 for coverage: https://github.com/tc39/test262/issues/3298
--
You are receiving this mail because:
You are the assignee for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.webkit.org/pipermail/webkit-unassigned/attachments/20211104/b5914655/attachment.htm>
More information about the webkit-unassigned
mailing list