serenity/Userland
Luke Wilde 5bc3371226 LibJS: Perform received abrupt generator completions in the generator
Previously, throw and return completions would not be executed inside
the generator. This is incorrect, as throw and return need to perform
unwinds which can potentially execute more code inside the generator,
such as finally blocks.

This is done by also passing the completion type alongside the passed
in value. The continuation block will immediately extract and type and
value and perform the appropriate operation for the given type.

For normal completions, this is continuing as normal.
For throw completions, it will perform `throw <value>`.
For return completions, it will perform `return <value>`, which is a
`Yield return` in this case due to being inside a generator.

This also refactors GeneratorObject to properly send across the
completion type and value to the generator inside of trying to operate
on the completions itself.

This is a prerequisite for yield*, as it performs special iterator
operations when receiving a throw/return completion and does not
complete the generator like the regular yield would.

There's still more work to be done to make GeneratorObject::execute
be closer to the spec. It's mostly a restructuring of the existing
GeneratorObject::next_impl.
2022-11-26 12:55:59 +01:00
..
Applets LibGUI+Taskbar+Applets+Applications: Set various windows as Popups 2022-11-19 16:04:42 +01:00
Applications Browser: Replace history entry if loading URL because of a redirect 2022-11-26 11:03:24 +01:00
Demos Everywhere: Mark dependencies of most targets as PRIVATE 2022-11-01 14:49:09 +00:00
DevTools Profiler: Don't stop disassembly on invalid instructions 2022-11-26 12:50:38 +01:00
DynamicLoader LibC: Properly implement stack protectors 2022-11-01 14:49:09 +00:00
Games 2048: Call event.ignore() correctly in 2048's BoardView keydown handler 2022-11-14 16:08:11 +00:00
Libraries LibJS: Perform received abrupt generator completions in the generator 2022-11-26 12:55:59 +01:00
Services LibWeb+WebContent: Label redirects with new FrameLoader::Type::Redirect 2022-11-26 11:03:24 +01:00
Shell Shell: Re-block SIGTT{IN,OU} on start 2022-11-03 00:01:42 +03:30
Utilities disasm: Demangle symbols 2022-11-26 12:50:38 +01:00
CMakeLists.txt Meta+Userland: Add ENABLE_USERSPACE_COVERAGE_COLLECTION CMake option 2022-05-02 01:46:18 +02:00