Skip to content

unhandledrejection Promise #1004

@tuchida

Description

@tuchida

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    embedding RhinoIssues related to enbedding RhinofeatureIssues considered a new feature

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions