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

unhandledrejection Promise #1004

Closed
tuchida opened this issue Aug 7, 2021 · 2 comments
Closed

unhandledrejection Promise #1004

tuchida opened this issue Aug 7, 2021 · 2 comments
Labels
embedding Rhino Issues related to enbedding Rhino feature Issues considered a new feature

Comments

@tuchida
Copy link
Contributor

tuchida commented Aug 7, 2021

https://developer.mozilla.org/en-US/docs/Web/API/Window/unhandledrejection_event

// Rhino
new Promise((resolve) => {
  print('resolve');
  resolve();
}).then(() => {
  p('');  // ReferenceError
});  // without .catch()

Rhino

resolve
[object Promise]

SpiderMonkey

Uncaught (in promise) ReferenceError: p is not defined
    <anonymous> debugger eval code:5
    promise callback* debugger eval code:4

node

ref. https://nodejs.org/api/cli.html#cli_unhandled_rejections_mode

> (node:2889648) UnhandledPromiseRejectionWarning: ReferenceError: p is not defined
    at REPL6:5:3
    at processTicksAndRejections (internal/process/task_queues.js:95:5)

I think it will be difficult to debug without displaying an error or killing the process.

@gbrail
Copy link
Collaborator

gbrail commented Aug 9, 2021

Yes, I can see how that's supposed to result in an "uncatchable exception" actually and that Rhino should be throwing it. I can also see why existing test suites didn't catch it. Let's see what we can do.

@p-bakker p-bakker added the feature Issues considered a new feature label Sep 29, 2021
@p-bakker p-bakker added this to the Release 1.7.14 milestone Sep 29, 2021
@gbrail
Copy link
Collaborator

gbrail commented Oct 8, 2021

Fixed in #1007

@p-bakker p-bakker added the embedding Rhino Issues related to enbedding Rhino label Nov 10, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
embedding Rhino Issues related to enbedding Rhino feature Issues considered a new feature
Projects
None yet
Development

No branches or pull requests

3 participants