We return early from the DateTimeFormat constructor to avoid crashing on
assertions when the CLDR is disabled. However, after commit 019211b, the
spec now mandates we assert the time zone identifier is valid. The early
return resulted in this identifier being an empty string.
This constructor was easily confused with a copy constructor, and it was
possible to accidentally copy-construct Objects in at least one way that
we dicovered (via generic ThrowCompletionOr construction).
This patch adds a mandatory ConstructWithPrototypeTag parameter to the
constructor to disambiguate it.
Note that js_rope_string() has been folded into this, the old name was
misleading - it would not always create a rope string, only if both
sides are not empty strings. Use a three-argument create() overload
instead.
Three standalone Cell creation functions remain in the JS namespace:
- js_bigint()
- js_string()
- js_symbol()
All of them are leftovers from early iterations when LibJS still took
inspiration from JSC, which itself has jsString(). Nowadays, we pretty
much exclusively use static create() functions to construct types
allocated on the JS heap, and there's no reason to not do the same for
these.
Also change the return type from BigInt* to NonnullGCPtr<BigInt> while
we're here.
This is patch 1/3, replacement of js_string() and js_symbol() follow.
This will make it easier to support both string types at the same time
while we convert code, and tracking down remaining uses.
One big exception is Value::to_string() in LibJS, where the name is
dictated by the ToString AO.
We have a new, improved string type coming up in AK (OOM aware, no null
state), and while it's going to use UTF-8, the name UTF8String is a
mouthful - so let's free up the String name by renaming the existing
class.
Making the old one have an annoying name will hopefully also help with
quick adoption :^)
This is an editorial change to the ECMA-402 spec. See:
46aa5cc
Also add an ECMA-402 spec link to the DefaultTimeZone implementation, as
that definition supersedes ECMA-262.
Much easier to manage and view diffs this way, rather than one large
single line. This will soon be the only method in this file, so there's
no concern over taking up too much vertical space here.
This is an editorial change to the Intl Enumeration API proposal. See:
807b444
Note that this was followed by a normative change to actually ensure the
returned values are canonical:
075a6dc
But the values we return are already canonical.
This is a normative change in the Intl Locale Info proposal. See:
171d3ad
Note this doesn't affect us because we don't have collation info from
the CLDR; we just return ["default"] here.
In a subclass of Cell, we cannot use Cell::vm() before the base Cell
object itself is constructed. Use the Realm's VM instead.
This was caught by UBSAN with vptr sanitation enabled.
This is generated by GenerateLocaleData, which will soon be in the
Locale namespace. Move it out of CurrencyCode.h, as that will continue
to live in the Unicode namespace.