Commit graph

4243 commits

Author SHA1 Message Date
Daniel Bertalan
be7bc41470 LibJS: Fix mix-up between assignment and comparison 2023-05-02 07:03:57 -04:00
Matthew Olsson
a9d192e882 LibJS+LibWeb: Explicitly mark ignored members in visit_edges methods 2023-04-30 06:04:33 +02:00
Matthew Olsson
39d8c8d2a9 LibJS+LibWeb: Add missing visit calls in visit_edges implementations 2023-04-30 06:04:33 +02:00
Matthew Olsson
82eeee2008 LibJS+LibWeb: Normalize calls to Base::visit_edges in GC objects 2023-04-30 06:04:33 +02:00
Tim Schumacher
5e7c838160 AK: Rename Stream::format() to Stream::write_formatted()
This brings the function name in line with how we usually name those
functions, which is with a `read_` or `write_` prefix depending on what
they do.

While at it, make the internal `_impl` function private and not-virtual,
since there is no good reason to ever override that function.
2023-04-25 07:30:16 +01:00
Peter Brottveit Bock
b6deb8fd42 LibJS: Replace DeprecatedString with String in strip_ansi 2023-04-23 16:56:06 +02:00
Peter Brottveit Bock
fac7045a44 LibJS: Use Stream::format instead of manually formating and printing 2023-04-23 16:56:06 +02:00
Sam Atkins
6d93e03211 LibWeb+Browser+Ladybird: Use JS::SafeFunction for EventLoop callbacks
This automatically protects captured objects from being GC'd before the
callback runs.
2023-04-21 20:44:47 +01:00
Linus Groh
d4eaaf905c LibJS: Port create_iterator_result_object() to NonnullGCPtr 2023-04-15 16:26:42 +02:00
Linus Groh
aff1ec6014 LibJS: Port iterator_step() to GCPtr 2023-04-15 16:23:03 +02:00
Linus Groh
e54536421a LibJS: Port iterator_next() to NonnullGCPtr 2023-04-15 16:22:57 +02:00
Linus Groh
b110258848 LibJS: Port this_symbol_value() to NonnullGCPtr 2023-04-15 16:06:52 +02:00
Linus Groh
dd91f1a5a5 LibJS: Port this_string_value() to NonnullGCPtr 2023-04-15 16:06:18 +02:00
Linus Groh
9c6eba771a LibJS: Port this_bigint_value() to NonnullGCPtr 2023-04-15 16:06:02 +02:00
Linus Groh
d8ee4c0e7d LibJS: Add remaining missing spec comments to StringPrototype
The changes from ac2f109 were from an old branch, which either had a
rebase accident or was simply incomplete. Should be complete now :^)
2023-04-15 16:00:59 +02:00
Linus Groh
ac2f1098f7 LibJS: Add spec comments to StringPrototype 2023-04-15 14:07:28 +02:00
Linus Groh
16197af60d LibJS: Add spec comments to StringObject 2023-04-15 14:07:28 +02:00
Linus Groh
9cf1a244f8 LibJS: Add spec comments to ProxyConstructor 2023-04-15 14:07:28 +02:00
Linus Groh
b1ea436093 LibJS: Add spec comments to ObjectPrototype 2023-04-15 14:07:28 +02:00
Linus Groh
50cb4f08a1 LibJS: Add spec comments to ObjectConstructor 2023-04-15 14:07:28 +02:00
Linus Groh
f0dd425492 LibJS: Add spec comments to Object 2023-04-15 14:07:28 +02:00
Linus Groh
63624a3a67 LibJS: Add spec comments to NumberConstructor 2023-04-15 14:07:28 +02:00
Linus Groh
23d9096541 LibJS: Add spec comments to MathObject 2023-04-15 14:07:28 +02:00
Linus Groh
f3f78642f4 LibJS: Add spec comments to MapPrototype 2023-04-15 14:07:28 +02:00
Linus Groh
2140200a19 LibJS: Add spec comments to GlobalObject 2023-04-15 14:07:28 +02:00
Linus Groh
89503a0cfe LibJS: Port PrototypeObject::typed_this_value() to NonnullGCPtr 2023-04-14 09:59:29 +02:00
Linus Groh
a23dd88f61 LibJS: Port PrototypeObject::typed_this_object() to NonnullGCPtr 2023-04-14 09:59:29 +02:00
Linus Groh
15360e50d3 LibJS: Port PrototypeObject::this_object() to NonnullGCPtr 2023-04-14 09:59:29 +02:00
Linus Groh
b33b0d60e6 LibJS: Port Value::get_method() to GCPtr 2023-04-14 09:59:29 +02:00
Linus Groh
9279b0780d LibJS: Port Value::to_bigint() to NonnullGCPtr 2023-04-14 09:59:29 +02:00
Linus Groh
f345f72b55 LibJS: Port Value::to_object() to NonnullGCPtr 2023-04-14 09:59:29 +02:00
Linus Groh
e79f5b6e85 LibJS: Port Value::to_primitive_string() to NonnullGCPtr 2023-04-14 09:59:29 +02:00
Linus Groh
2555d7a36a LibJS: Make well-known symbol getters return NonnullGCPtr
None of these are ever null after the VM has been initialized, as proved
by virtually every caller immediately dereferencing the raw pointer.
2023-04-13 14:29:42 +02:00
Linus Groh
b84f8fb55b LibJS: Make intrinsics getters return NonnullGCPtr
Some of these are allocated upon initialization of the intrinsics, and
some lazily, but in neither case the getters actually return a nullptr.

This saves us a whole bunch of pointer dereferences (as NonnullGCPtr has
an `operator T&()`), and also has the interesting side effect of forcing
us to explicitly use the FunctionObject& overload of call(), as passing
a NonnullGCPtr is ambigous - it could implicitly be turned into a Value
_or_ a FunctionObject& (so we have to dereference manually).
2023-04-13 14:29:42 +02:00
Linus Groh
ed9e2366da LibJS: Add spec comments to WeakSetPrototype 2023-04-13 13:04:44 +02:00
Linus Groh
bccffed7e9 LibJS: Add spec comments to WeakSetConstructor 2023-04-13 13:04:44 +02:00
Linus Groh
77fc05afd6 LibJS: Add spec comments to WeakRefPrototype 2023-04-13 13:04:44 +02:00
Linus Groh
7c9f1dcced LibJS: Add spec comments to WeakRefConstructor 2023-04-13 13:04:44 +02:00
Linus Groh
7bf92b5c3b LibJS: Add spec comments to WeakMapPrototype 2023-04-13 13:04:44 +02:00
Linus Groh
627dc1b88b LibJS: Add spec comments to WeakMapConstructor 2023-04-13 13:04:44 +02:00
Linus Groh
89bcc05a0d LibJS: Add spec comments to TypedArrayPrototype 2023-04-13 13:04:44 +02:00
Linus Groh
aefa053473 LibJS: Add spec comments to TypedArrayConstructor 2023-04-13 13:04:44 +02:00
Linus Groh
81c6ad047a LibJS: Add spec comments to SymbolPrototype 2023-04-13 13:04:44 +02:00
Linus Groh
0ae511edae LibJS: Add spec comments to SymbolConstructor 2023-04-13 13:04:44 +02:00
Linus Groh
066133d97b LibJS: Add spec comments to StringConstructor 2023-04-13 13:04:44 +02:00
Linus Groh
1b3c3f9777 LibJS: Add spec comments to SetPrototype 2023-04-13 13:04:44 +02:00
Linus Groh
58566d2a3f LibJS: Add spec comments to SetConstructor 2023-04-13 13:04:44 +02:00
Timothy Flynn
f816a24b86 LibJS: Update spec numbers for the Intl NumberFormat v3 proposal
This proposal has been merged into the main ECMA-402 spec. See:
4257160

Note this includes some editorial and normative changes made when the
proposal was merged into the main spec, but are not in the proposal spec
itself. In particular, the following AOs were changed:

    PartitionNumberRangePattern (normative)
    SetNumberFormatDigitOptions (editorial)
2023-04-11 23:22:32 +02:00
Timothy Flynn
b411e30024 LibJS: Require a [[RoundingMode]] slot within FormatNumericToString
This was optional to work around a spec issue. That issue was fixed and
brought into LibJS in commit 5b3b14b, but this FIXME was neglected.
2023-04-11 23:22:32 +02:00
Ben Wiederhake
560133a0c6 Everywhere: Remove unused DeprecatedString includes 2023-04-09 22:00:54 +02:00