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

Allow async functions to throw #178

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

cpcallen
Copy link
Collaborator

Provide a convenient means to allow asynchronous functions to throw an exception rather than return a value.

Provide a convenient means to allow asynchronous functions to throw an exception rather than return a value.
interpreter.js Outdated Show resolved Hide resolved
Existing usage includes calling the callback with no arguments, intending it to return undefined.  Preserve this behaviour by treating zero and one arguments equivalently, and only throwing if it is called with two or more.

(This will break any existing usage which calls the callback with more than one argument, but that ought to be fairly uncommon!)
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.

2 participants