Summary: | Array.prototype.toLocaleString does not respect deletion of Object.prototype.toLocaleString | ||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Product: | WebKit | Reporter: | Richard Gibson <richard.gibson> | ||||||||||
Component: | JavaScriptCore | Assignee: | Yusuke Suzuki <ysuzuki> | ||||||||||
Status: | RESOLVED FIXED | ||||||||||||
Severity: | Normal | CC: | ashvayka, ews-watchlist, fpizlo, keith_miller, mark.lam, msaboff, saam, tzagallo, webkit-bug-importer, ysuzuki | ||||||||||
Priority: | P2 | Keywords: | InRadar | ||||||||||
Version: | WebKit Nightly Build | ||||||||||||
Hardware: | Unspecified | ||||||||||||
OS: | Unspecified | ||||||||||||
Attachments: |
|
Description
Richard Gibson
2021-11-04 13:24:46 PDT
Instead of this, we will implement Intl.ListFormat based new implementation. *** Bug 232724 has been marked as a duplicate of this bug. *** Intl.ListFormat-based implementation is deferred. For now, let's implement the current Array.prototype.toLocaleString in ECMA 402. Created attachment 448233 [details]
Patch
Created attachment 448234 [details]
Patch
Created attachment 448236 [details]
Patch
Created attachment 448243 [details]
Patch
Comment on attachment 448243 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=448243&action=review Sweet, r=me with nits. > Source/JavaScriptCore/runtime/ArrayPrototype.cpp:696 > + if (UNLIKELY(arguments.hasOverflowed())) { Given the default inline capacity of 8, can this be simplified to `ASSERT(!arguments.hasOverflowed())`? > Source/JavaScriptCore/runtime/ArrayPrototype.cpp:760 > + JSValue element = thisObject->get(globalObject, k); I appreciate following the spec 1:1, but since we are already a bit off with handling of 0th element, maybe we could do `thisObject->getIndex(globalObject, k)` here? Also, getIndex() is currently used in trunk. > Source/JavaScriptCore/runtime/ArrayPrototype.cpp:809 > + JSValue element = thisObject->get(globalObject, k); Since we are changing this line, maybe we could do `thisObject->getIndex(globalObject, k)`? Comment on attachment 448243 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=448243&action=review >> Source/JavaScriptCore/runtime/ArrayPrototype.cpp:696 >> + if (UNLIKELY(arguments.hasOverflowed())) { > > Given the default inline capacity of 8, can this be simplified to `ASSERT(!arguments.hasOverflowed())`? Sounds good! >> Source/JavaScriptCore/runtime/ArrayPrototype.cpp:760 >> + JSValue element = thisObject->get(globalObject, k); > > I appreciate following the spec 1:1, but since we are already a bit off with handling of 0th element, maybe we could do `thisObject->getIndex(globalObject, k)` here? > Also, getIndex() is currently used in trunk. Nice, fixed. >> Source/JavaScriptCore/runtime/ArrayPrototype.cpp:809 >> + JSValue element = thisObject->get(globalObject, k); > > Since we are changing this line, maybe we could do `thisObject->getIndex(globalObject, k)`? Nice, fixed. Committed r287560 (245695@trunk): <https://commits.webkit.org/245695@trunk> Committed r287561 (245696@trunk): <https://commits.webkit.org/245696@trunk> |