-
Notifications
You must be signed in to change notification settings - Fork 5.4k
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
feat(web): add beforeunload event #14830
Conversation
This commit adds the 'beforeunload' event.
I changed this PR to require |
It appears there are no WPT tests that we can enable. @lucacasonato please take a look, we should update compatibility tables after landing this PR (with a note that |
The Deno 1.24 release adds support for the beforeunload event. Refs: denoland/deno#14830
The Deno 1.24 release adds support for the beforeunload event. Refs: denoland/deno#14830
Is there any reason why this PR added |
The former to use in denoland/std#2331, I guess the latter was supposed to be used in the op but was forgotten.. |
In that case, given that that same code shows up three times (in |
The `op_event_loop_has_more_work` op, introduced in denoland#14830, duplicates code from `JsRuntime::poll_event_loop`. That PR also added the unused method `JsRuntime::event_loop_has_work`, which is another duplication of that same code, and which isn't used anywhere. This change deduplicates this by renaming `JsRuntime::event_loop_has_work` to `event_loop_pending_state`, and making it the single place to determine what in the event loop is pending. This result is then returned in a struct which is used both in the event loop and in the `op_event_loop_has_more_work` op.
#15147) The `op_event_loop_has_more_work` op, introduced in #14830, duplicates code from `JsRuntime::poll_event_loop`. That PR also added the unused method `JsRuntime::event_loop_has_work`, which is another duplication of that same code, and which isn't used anywhere. This change deduplicates this by renaming `JsRuntime::event_loop_has_work` to `event_loop_pending_state`, and making it the single place to determine what in the event loop is pending. This result is then returned in a struct which is used both in the event loop and in the `op_event_loop_has_more_work` op.
The Deno 1.24 release adds support for the beforeunload event. Refs: denoland/deno#14830
The Deno 1.24 release adds support for the beforeunload event. Refs: denoland/deno#14830
The Deno 1.24 release adds support for the beforeunload event. Refs: denoland/deno#14830
This commit adds the 'beforeunload' event.