Skip to content
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

fix(cli): dispatch unload on exit #9088

Merged
merged 2 commits into from
Jan 12, 2021
Merged

Conversation

kt3k
Copy link
Member

@kt3k kt3k commented Jan 11, 2021

This PR adds the dispatching of unload event before sending op_exit. Closes #3603.

(The issue also suggests it should call unload hooks at signals like SIGINT, etc, but that seems very difficult (complex) to implement because if the process attach something to signal, the default behavior is lost. So we need to simulate the default behavior for each signal to do that, but that seems unreasonably complex to implement and maintain.)

Copy link
Member

@satyarohith satyarohith left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good!

@@ -2631,6 +2631,11 @@ itest!(_077_fetch_empty {
exit_code: 1,
});

itest!(_078_unload_on_exit {
args: "run -A 078_unload_on_exit.ts",
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can -A be removed?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Right. Thanks!

Copy link
Member

@ry ry left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM - thanks @kt3k

@ry ry merged commit fd56fa8 into denoland:master Jan 12, 2021
@kt3k kt3k deleted the fix/unload-on-exit branch January 12, 2021 12:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Clean up on Deno.exit()
3 participants