Linus Groh
c132064ee9
LibJS: Convert new_private_environment() to NonnullGCPtr
2022-12-16 09:59:56 +01:00
Linus Groh
208be8b86d
LibJS: Convert new_function_environment() to NonnullGCPtr
2022-12-16 09:59:56 +01:00
Linus Groh
111a38c464
LibJS: Convert new_object_environment() to NonnullGCPtr
2022-12-16 09:59:56 +01:00
Linus Groh
107e06a396
LibJS: Convert new_declarative_environment() to NonnullGCPtr
2022-12-16 09:59:56 +01:00
Timothy Flynn
2dfa87814e
LibJS: Update spec comments for replacing digits in Intl.NumberFormat
...
This is an editorial change in the ECMA-402 spec. See:
06d95ed
Note the new spec steps basically match our implementation in LibLocale.
2022-12-15 16:24:29 +00:00
Timothy Flynn
01fc025e9d
LibJS: Fix a typo in an Intl.DateTimeFormat spec comment
...
This is an editorial change in the ECMA-402 spec. See:
078bea0
2022-12-15 16:24:29 +00:00
Linus Groh
bd40464195
LibJS: Convert standalone construct() to NonnullGCPtr
2022-12-15 06:56:37 -05:00
Linus Groh
6ae79a84df
LibJS: Convert Object::construct() to NonnullGCPtr
2022-12-15 06:56:37 -05:00
Linus Groh
03acbf0beb
LibJS: Convert FunctionObject::internal_construct() to NonnullGCPtr
2022-12-15 06:56:37 -05:00
Linus Groh
1c24b82dd7
LibJS: Convert ordinary_create_from_constructor() to NonnullGCPtr
2022-12-15 06:56:37 -05:00
Linus Groh
22089436ed
LibJS: Convert Heap::allocate{,_without_realm}() to NonnullGCPtr
2022-12-15 06:56:37 -05:00
Linus Groh
029db614e3
LibJS: Ensure Optional<Completion>'s defaults to empty completion
...
Default-constructing the m_value Completion made it have an undefined
JS value when not overridden in a constructor, such as the conditional
initialization in Optional(Optional<JS::Completion> const&).
See investigation by Tim here:
https://github.com/SerenityOS/serenity/pull/16498#discussion_r1049090456
Co-authored-by: Timothy Flynn <trflynn89@pm.me>
2022-12-15 06:56:37 -05:00
Timothy Flynn
a2cf026b30
LibJS: Throw a RangeError when when formatting strings in DurationFormat
...
This is a normative change in the Intl.DurationFormat proposal. See:
2546080
2022-12-15 09:40:09 +00:00
Timothy Flynn
010888acec
LibJS: Access DurationRecord properties in alphabetical order
...
This is a normative change in the Intl.DurationFormat proposal. See:
42e99b8
2022-12-15 09:40:09 +00:00
Timothy Flynn
85f079dc6b
LibJS: Move IsValidDurationRecord check to ToDurationRecord
...
This is an editorial change in the Intl.DurationFormat proposal. See:
fb21723
2022-12-15 09:40:09 +00:00
Timothy Flynn
0086a3acdb
LibJS: Remove infallibility markers from some Intl.DurationFormat AOs
...
This is an editorial change in the Intl.DurationFormat proposal. See:
fa2b3d0
2022-12-15 09:40:09 +00:00
Timothy Flynn
897c7f7cc2
LibJS: Set DateTimeFormat's time zone when the CLDR download is disabled
...
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.
2022-12-14 15:24:48 +00:00
Andreas Kling
4abdb68655
LibJS: Remove Object(Object& prototype) footgun
...
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.
2022-12-14 15:11:57 +01:00
Andreas Kling
42b5c896e8
LibJS: Don't "copy construct" temporary value in ThrowCompletionOr ctor
...
It was possible for the generic ThrowCompletionOr constructor to
"copy-construct" a JS Object when instantiating a ThrowCompletionOr
via e.g `return *object;`.
This happened because it chose the Object(Object& prototype) constructor
which will be removed in a subsequent commit. It was not easy to debug.
As a first step towards avoiding this in the future, the generic
ThrowCompletionOr constructor now takes the value as a const reference.
2022-12-14 15:11:57 +01:00
Linus Groh
b90f505409
LibJS: Convert WrappedFunction::create() to NonnullGCPtr
2022-12-14 09:59:45 +00:00
Linus Groh
54ebf71da2
LibJS: Convert WeakSet::create() to NonnullGCPtr
2022-12-14 09:59:45 +00:00
Linus Groh
cac71a6847
LibJS: Convert WeakRef::create() to NonnullGCPtr
2022-12-14 09:59:45 +00:00
Linus Groh
3358ddfd0e
LibJS: Convert WeakMap::create() to NonnullGCPtr
2022-12-14 09:59:45 +00:00
Linus Groh
37c85fa07e
LibJS: Convert TypedArray::create() to NonnullGCPtr
2022-12-14 09:59:45 +00:00
Linus Groh
dd3d133968
LibJS: Convert SymbolObject::create() to NonnullGCPtr
2022-12-14 09:59:45 +00:00
Linus Groh
049e99b5f0
LibJS: Convert StringObject::create() to NonnullGCPtr
2022-12-14 09:59:45 +00:00
Linus Groh
337c55a893
LibJS: Convert StringIterator::create() to NonnullGCPtr
2022-12-14 09:59:45 +00:00
Linus Groh
c200c247e4
LibJS: Convert SetIterator::create() to NonnullGCPtr
2022-12-14 09:59:45 +00:00
Linus Groh
1c8b700248
LibJS: Convert Set::create() to NonnullGCPtr
2022-12-14 09:59:45 +00:00
Linus Groh
9946e9e874
LibJS: Convert RegExpStringIterator::create() to NonnullGCPtr
2022-12-14 09:59:45 +00:00
Linus Groh
cad40ec953
LibJS: Convert RegExpObject::create() to NonnullGCPtr
2022-12-14 09:59:45 +00:00
Linus Groh
bfb8d83535
LibJS: Convert Realm::create() to NonnullGCPtr
2022-12-14 09:59:45 +00:00
Linus Groh
e0818bf21e
LibJS: Convert ProxyObject::create() to NonnullGCPtr
2022-12-14 09:59:45 +00:00
Linus Groh
6e386acb11
LibJS: Convert PromiseResolvingFunction::create() to NonnullGCPtr
2022-12-14 09:59:45 +00:00
Linus Groh
d3cb7cd584
LibJS: Convert PromiseFooElementFunction::create() to NonnullGCPtr
2022-12-14 09:59:45 +00:00
Linus Groh
716c8bdc9d
LibJS: Convert PromiseReaction::create() to NonnullGCPtr
2022-12-14 09:59:45 +00:00
Linus Groh
a4d85cd522
LibJS: Convert Promise::create() to NonnullGCPtr
2022-12-14 09:59:45 +00:00
Linus Groh
ddc6e139a6
LibJS: Convert Object::create() to NonnullGCPtr
2022-12-14 09:59:45 +00:00
Linus Groh
f990095728
LibJS: Convert NumberObject::create() to NonnullGCPtr
2022-12-14 09:59:45 +00:00
Linus Groh
b42e293ddd
LibJS: Convert NativeFunction::create() to NonnullGCPtr
2022-12-14 09:59:45 +00:00
Linus Groh
9846d23c79
LibJS: Convert MapIterator::create() to NonnullGCPtr
2022-12-14 09:59:45 +00:00
Linus Groh
d48cdc7fa6
LibJS: Convert Map::create() to NonnullGCPtr
2022-12-14 09:59:45 +00:00
Linus Groh
45f903da00
LibJS: Convert Intrinsics::create() to NonnullGCPtr
2022-12-14 09:59:45 +00:00
Linus Groh
237402aea9
LibJS: Convert Intl::Segments::create() to NonnullGCPtr
2022-12-14 09:59:45 +00:00
Linus Groh
df589bb05b
LibJS: Convert Intl::SegmentIterator::create() to NonnullGCPtr
2022-12-14 09:59:45 +00:00
Linus Groh
658bd2f342
LibJS: Convert Intl::NumberFormatFunction::create() to NonnullGCPtr
2022-12-14 09:59:45 +00:00
Linus Groh
b2034c59dc
LibJS: Convert Intl::Locale::create() to NonnullGCPtr
2022-12-14 09:59:45 +00:00
Linus Groh
81d5bbcb04
LibJS: Convert Intl::DateTimeFormatFunction::create() to NonnullGCPtr
2022-12-14 09:59:45 +00:00
Linus Groh
46acce5142
LibJS: Convert Intl::CollatorCompareFunction::create() to NonnullGCPtr
2022-12-14 09:59:45 +00:00
Linus Groh
83de01043f
LibJS: Convert GeneratorObject::create() to NonnullGCPtr
2022-12-14 09:59:45 +00:00