Commit Graph

9 Commits

Author SHA1 Message Date
Linus Groh
01c2570678 LibJS: Annotate Promise implementation with spec comments
I wanted to do this for a long time. The guts of Promise are pretty
complex, and it's easier to understand with the spec right next to it.
Also found a couple of issues along the way :^)
2021-11-14 15:27:46 +00:00
Linus Groh
5832de62fe LibJS: Convert NativeFunction::{call,construct}() to ThrowCompletionOr
Both at the same time because many of them call construct() in call()
and I'm not keen on adding a bunch of temporary plumbing to turn
exceptions into throw completions.
Also changes the return value of construct() to Object* instead of Value
as it always needs to return an object; allowing an arbitrary Value is a
massive foot gun.
2021-10-21 09:02:23 +01:00
Linus Groh
fe86b04b42 LibJS: Convert define_property_or_throw() to ThrowCompletionOr 2021-10-03 20:14:03 +01:00
Linus Groh
364dd42fc8 LibJS: Convert create_data_property_or_throw() to ThrowCompletionOr 2021-10-03 20:14:03 +01:00
Idan Horowitz
ab594e5f2f LibJS: Convert Value::invoke and VM::call to ThrowCompletionOr 2021-09-23 23:59:13 +03:00
Andreas Kling
971dc44ed3 LibJS: Don't use MarkedValueList in PromiseValueList
Instead, override visit_edges() and mark the values like any other Cell
subclass would.

This makes PromiseValueList play nice with zombification.
2021-09-11 22:16:30 +02:00
Timothy Flynn
949f294444 LibJS: Implement Promise.allSettled on the Promise constructor 2021-08-23 00:01:46 +01:00
Timothy Flynn
4dffa40a8d LibJS: Implement Promise.any on the Promise constructor 2021-08-23 00:01:46 +01:00
Timothy Flynn
417523507e LibJS: Generalize PromiseAllResolveElementFunction common functionality
The element-resolving functions on the Promise constructor are all very
similar. To prepare for more of these functions to be implemented, break
out common parts into a base class.
2021-08-23 00:01:46 +01:00