-
Notifications
You must be signed in to change notification settings - Fork 109
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Enable promises behind a feature #238
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice!
Simplified the test runner since we can now rely on proises :D |
I left an offline note to @jeffcharles, but I'll add here too for visibility: before landing this I'd like for us to ensure that unhandled rejected promises are behaving correctly, a preliminary test on my end shows that the current behaviour doesn't throw, which is wrong afaik. So we might have to fix that. |
This is probably also a reminder that we should run test262 |
Yeah, going a bit further, wpt has a suite for promises https://web-platform-tests.org/writing-tests/testharness-api.html#promise-rejection, so perhaps we should enable that to avoid missing any edge cases. |
Discussed offline, we're going to put this behind a default off feature for now |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🎉
This commit refactors the event loop handling code, mainly by extracting the common pieces into a reusable function. Additionally, this commit ensures that the result of `Promise.finish` is corectly handled, which fixes execution of code with top level awaits. Finally, this commit also ensures that we test the `experimental_event_loop` in CI for the CLI and core crates (follow-up to bytecodealliance#238)
* Tidy up event loop handling code This commit refactors the event loop handling code, mainly by extracting the common pieces into a reusable function. Additionally, this commit ensures that the result of `Promise.finish` is corectly handled, which fixes execution of code with top level awaits. Finally, this commit also ensures that we test the `experimental_event_loop` in CI for the CLI and core crates (follow-up to #238) * Clippy fixes * Assert fuel conditionally When the `experimental_event_loop` feature is enabled, a bit more work is done when executing JS code, therefore there's more fuel usage reported in some tests. * Create `cli-features.yml` * Add right naming * Fix `runs-on` key * Typo and fixes
The feature is off by default. It can be enabled by running
make cli CORE_FEATURES=experimental_event_loop
and tests can be run by invokingmake test-cli CORE_FEATURES=experimental_event_loop CLI_FEATURES=experimental_event_loop
.