-
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
Add window.close() #4474
Merged
Merged
Add window.close() #4474
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
kevinkassimo
force-pushed
the
window/close
branch
from
March 25, 2020 03:06
c296ad8
to
d76abc6
Compare
ry
approved these changes
Mar 25, 2020
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.
LGTM : )
This was referenced Mar 25, 2020
Closed
dubiousjim
added a commit
to dubiousjim/deno
that referenced
this pull request
Mar 29, 2020
* denoland/master: (35 commits) Ignore flaky test cafile_info (denoland#4517) fix(inspector): proper error message on port collision (denoland#4514) feat: Added colors to doc output (denoland#4518) v0.38.0 feat: Add "deno doc" subcommand (denoland#4500) Update to Prettier 2 and use ES Private Fields (denoland#4498) upgrade: dprint 0.9.6 (denoland#4509) upgrade: rusty_v8 to v0.3.9 (denoland#4505) feat: Support Inspector / Chrome Devtools (denoland#4484) Improve isatty and kill API docs; Deno.kill() - throw on Windows (denoland#4497) refactor: rename ConsoleOptions to InspectOptions (denoland#4493) upgrade: dprint 0.9.5 (denoland#4491) feat: window.close() (denoland#4474) errors: replace .lines with explicit .split newline (denoland#4483) doc: improve various API docs and include examples (denoland#4486) hide source line if error message longer than 150 chars (denoland#4487) fix: add fsEvent notify::Error casts (denoland#4488) feat: add queueMicrotask to d.ts (denoland#4477) Revert "avoid using same port number for test (denoland#4147)" docs: update manual about how to run tests for std (denoland#4462) ...
dubiousjim
added a commit
to dubiousjim/deno
that referenced
this pull request
Mar 29, 2020
* denoland/master: Ignore flaky test cafile_info (denoland#4517) fix(inspector): proper error message on port collision (denoland#4514) feat: Added colors to doc output (denoland#4518) v0.38.0 feat: Add "deno doc" subcommand (denoland#4500) Update to Prettier 2 and use ES Private Fields (denoland#4498) upgrade: dprint 0.9.6 (denoland#4509) upgrade: rusty_v8 to v0.3.9 (denoland#4505) feat: Support Inspector / Chrome Devtools (denoland#4484) Improve isatty and kill API docs; Deno.kill() - throw on Windows (denoland#4497) refactor: rename ConsoleOptions to InspectOptions (denoland#4493) upgrade: dprint 0.9.5 (denoland#4491) feat: window.close() (denoland#4474) errors: replace .lines with explicit .split newline (denoland#4483) doc: improve various API docs and include examples (denoland#4486) hide source line if error message longer than 150 chars (denoland#4487) fix: add fsEvent notify::Error casts (denoland#4488)
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Closes #4382
While this works with the intention to push a task to close the
window
, it does not match the behavior in the browser perfectly, since in Deno we only have 1 single task source (timer task source), while browsers have multiple (andwindow.close()
should have been pushing a task to DOM manipulation task source). In browsers it seems that ready timers would be depleted before tasks on DOM manipulation task source tasks are popped, but it is very hard to simulate this behavior under current design of Deno without making things overly complex (like adding another binding simply forwindow.close()
, which I experimented with but does not deem worthwhile). This means thatPromise.resolve().then(() => setTimeout(() => console.log("sth"), 0))
is not going to be fired if placed afterwindow.close()
under Deno, while it would in Chrome.Maybe we can further rectify the concrete behavior in the future if we were to revamp the task queueing design.
Also have to add(likely resolved)[WILDCARD]
in the test, since for some strange reason test result lines somehow got mixed into the final captured stdout result (likely due to some concurrent running issues), so it prints some super strange stuff like this for me locally: