davidot
f324d91106
LibJS: Convert FinalizationRegistry::cleanup to ThrowCompletionOr
2022-02-08 09:12:42 +00:00
davidot
dcc284705b
LibJS: Always pop the execution context if we pushed one for bytecode
2022-02-08 09:12:42 +00:00
davidot
8108fc7f9c
LibJS: Convert Instruction::execute in bytecode to ThrowCompletionOr
...
This allows us to use TRY in these functions :^).
2022-02-08 09:12:42 +00:00
davidot
de90d54be0
LibJS: Convert ArrayBuffer construction to ThrowCompletionOr
...
This also allows us to create TypedArrays with an existing buffer thus
clearing up an additional FIXME in TextEncoder.
2022-02-08 09:12:42 +00:00
davidot
4136cbdb09
LibJS: Convert ScopeNode declaration functions to ThrowCompletionOr
...
This removes a number of vm.exception() checks which are now caught
directly by TRY. Make use of these checks in
{Global, Eval}DeclarationInstantiation and while we're here add spec
comments.
2022-02-08 09:12:42 +00:00
Andreas Kling
cc7a117f0f
LibJS: Add missing include to ShadowRealm.h
2022-02-07 22:39:57 +01:00
Andreas Kling
673e6f3a32
LibJS: Add missing include to ExecutionContext.h
2022-02-07 21:48:57 +01:00
Andreas Kling
54d10d8dda
LibJS: Add missing include to Handle.h
2022-02-07 21:05:30 +01:00
Andreas Kling
7ad4702cbf
LibJS: Unbreak build with JS_MODULE_DEBUG
...
Thanks to David for noticing this! :^)
2022-02-07 19:59:21 +01:00
Andreas Kling
aeb72fe9d0
LibJS: Reduce header dependency graph in Realm.h
2022-02-07 19:16:46 +01:00
Andreas Kling
6ddbe8f953
LibJS: Add [[HostDefined]] internal slot to Script objects
...
In C++, this is a raw pointer to a Script::HostDefined.
2022-02-07 19:16:46 +01:00
Andreas Kling
77a1ef06a4
LibJS: Add [[HostDefined]] internal slot to Realm objects
...
In C++, this is an OwnPtr<Realm::HostDefined>.
2022-02-07 19:16:45 +01:00
Andreas Kling
85cf80507f
LibJS: Make ScriptOrModule use WeakPtr instead of raw pointers
2022-02-07 19:16:45 +01:00
Linus Groh
acb91d7869
LibJS: Add spec comments to the NativeError constructor
2022-02-07 14:44:42 +00:00
Linus Groh
6a9eeb2c5c
LibJS: Add spec comments to the Error constructor
2022-02-07 14:41:37 +00:00
Linus Groh
a75ab15f15
LibJS: Add spec comments to Error.prototype.toString()
2022-02-07 14:35:29 +00:00
Linus Groh
e106d5ecf4
LibJS: Let Error prototypes inherit from PrototypeObject
2022-02-07 14:32:39 +00:00
Hendiadyoin1
89c82abf1f
LibJS: Implement non standard error.stack attribute
...
All other browser already support this feature.
There is a Stage 1 proposal to standardize this, but it does not seem
to be active.
2022-02-07 14:17:57 +00:00
Jorropo
dc42ca37bd
LibJS: Fix JSON.stringify with stale surrogate codepoints
...
This fix this test262 test:
built-ins/JSON/stringify/value-string-escape-unicode.js
2022-02-07 13:53:36 +00:00
Timothy Flynn
b0e5609b88
LibJS: Use GetV to look up the toJSON property in SerializeJSONProperty
...
The current implementation of step 2a sort of manually implemented GetV
with a ToObject + Get combo. But in the call to Get, the receiver wasn't
the correct object. So when invoking toJSON, the receiver was an Object
type rather than a BigInt.
This also adds spec comments to SerializeJSONProperty.
2022-02-07 09:24:09 +00:00
Linus Groh
6f20f49b21
Everywhere: Rename JS::PropertyKey variables from property_{name => key}
...
PropertyKey used to be called PropertyName, but got renamed. Let's
update all the variables of this type as well.
2022-02-06 22:02:45 +00:00
Timothy Flynn
cb57475168
LibJS: Implement BigInt.asUintN
2022-02-06 15:49:54 +00:00
Timothy Flynn
460c2caaf7
LibJS: Implement BigInt.asIntN
2022-02-06 15:49:54 +00:00
Timothy Flynn
72b3ea49d6
LibJS: Enable Temporal tests that now pass
...
These pass now that negative zero is disallowed by SignedBigInteger.
2022-02-06 15:49:54 +00:00
Andreas Kling
4d785b9aa0
LibJS: Mark Completion constructors with ALWAYS_INLINE
...
These were showing up in profiles.
2022-02-06 16:30:57 +01:00
Andreas Kling
2518f2045e
LibJS: Explicitly initialize primitive IndexedPropertyIterator members
2022-02-05 22:50:39 +01:00
Andreas Kling
0d60cf211d
LibJS: Cache valid indices in IndexedPropertyIterator
...
Refetching the list of indices every time we increment the iterator was
showing up hot & heavy in a profile of Discord.
2022-02-05 22:50:39 +01:00
Timothy Flynn
27d3de1f17
LibRegex: Do not continue searching input when the sticky bit is set
...
This partially reverts commit a962ee020a
.
When the sticky bit is set, the global bit should basically be ignored
except by external callers who want their own special behavior. For
example, RegExp.prototype [ @@match ] will use the global flag to
accumulate consecutive matches. But on the first failure, the regex
loop should break.
2022-02-05 19:06:50 +03:30
davidot
14d1601a76
LibJS: Remove the VERIFY_NOT_REACHED in link_and_eval_module
...
Since the spec does not fully define the entry points of modules what
this means is kind of unclear. But it does work in most cases and can
be useful. We do print out a warning just to clarify why there could be
strange things.
2022-02-05 11:52:51 +01:00
davidot
d46be7e7f2
LibJS: Visit internal values in PromiseValueList
2022-02-05 11:52:51 +01:00
davidot
212c8dad5e
LibJS: Keep handles on internal function while creating a class
...
It seems the stack search does not find all functions because they are
kept in variants and other structs. This meant some function could be
cleaned up while we were evaluating a class meaning it would fail/crash
when attempting to run the functions.
2022-02-05 11:52:51 +01:00
davidot
5749d85534
LibJS: Keep handles on promise functions while resolving a module
2022-02-05 11:52:51 +01:00
davidot
8da6c01d8f
LibJS: Remove the JS_TRACK_ZOMBIE_CELLS option
...
This feature had bitrotted somewhat and would trigger errors because
PrimitiveStrings were "destroyed" but because of this mode they were not
removed from the string cache. Even fixing that case running test-js
with the options still failed in more places.
2022-02-05 11:52:51 +01:00
Ali Mohammad Pur
a962ee020a
LibJS+LibRegex: Don't repeat regex match in regexp_exec()
...
LibRegex already implements this loop in a more performant way, so all
LibJS has to do here is to return things in the right shape, and not
loop over the input string.
Previously this was a quadratic operation on string length, which lead
to crazy execution times on failing regexps - now it's nice and fast :^)
Note that a Regex test has to be updated to remove the stateful flag as
it repeats matching on multiple strings.
2022-02-05 00:09:32 +01:00
Ali Mohammad Pur
2b028f6faa
LibRegex+LibJS: Avoid searching for more than one match in JS RegExps
...
All of JS's regular expression APIs only want a single match, so avoid
trying to produce more (which will be discarded anyway).
2022-02-05 00:09:32 +01:00
Linus Groh
e087cd574e
LibJS: Rename variables to 'calendarLike' in a couple of places
...
This is an editorial change in the Temporal spec.
See: 9af2d35
2022-02-04 20:00:34 +00:00
Linus Groh
c48f695b90
LibJS: Remove '-000000' check from ParseTemporalYearMonthString
...
This is an editorial change in the Temporal spec.
See: 3be4b5d
2022-02-04 20:00:34 +00:00
Linus Groh
28ac5a1333
LibJS: Update fallibility of ParseISODateTime in spec comments
...
This is an editorial change in the Temporal spec.
See: bc79069
2022-02-04 20:00:34 +00:00
Timothy Flynn
30a143c79e
LibJS: Explicitly handle invalid Date objects in UTC time setters
...
This is a normative change in the ECMA-262 spec:
ca53334
Note that this also fixes a few errors where we errantly converted the
stored time value to local time.
2022-02-04 13:47:50 +00:00
Timothy Flynn
fd7d0a31d9
LibJS: Explicitly handle invalid Date objects in local time setters
...
This is a normative change in the ECMA-262 spec:
ca53334
2022-02-04 13:47:50 +00:00
Linus Groh
40ba12aa7d
LibJS: Consider calls of parse_iso_date_time() fallible
...
See: https://github.com/tc39/proposal-temporal/pull/2027
2022-02-02 18:55:00 +00:00
Linus Groh
19a2b32065
LibJS: Reject '-000000' as extended year
...
This is a normative change in the Temporal spec.
See: e60ef9e
2022-02-02 14:46:52 +00:00
Idan Horowitz
2cd3d4a287
LibJS: Implement Intl %SegmentIteratorPrototype%.next ( )
2022-01-31 21:05:04 +02:00
Idan Horowitz
366468f1de
LibJS: Implement Intl %SegmentsPrototype%.containing
2022-01-31 21:05:04 +02:00
Idan Horowitz
96af50bbba
LibJS: Implement the Intl CreateSegmentDataObject AO
2022-01-31 21:05:04 +02:00
Idan Horowitz
cea6c81c77
LibJS: Implement the Intl.Segmenter FindBoundary AO
2022-01-31 21:05:04 +02:00
Idan Horowitz
b1d19b5917
LibJS: Convert Intl.Segmenter, Segments and SegmentIterator to Utf16
...
This is a precursor to implementing the FindBoundary AO, which operates
on Utf16 code unit indexes.
2022-01-31 21:05:04 +02:00
Timothy Flynn
6efbafa6e0
Everywhere: Update copyrights with my new serenityos.org e-mail :^)
2022-01-31 18:23:22 +00:00
Timothy Flynn
02b7bf34c9
LibJS: Implement BigInt IsLessThan according to the spec
2022-01-31 17:50:54 +00:00
Timothy Flynn
9ad3debf35
LibJS: Implement BigInt loose-equality according to the spec
2022-01-31 17:50:54 +00:00