We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
Errors which occur during parameter binding and evaluation should result in exceptions.
function* f(a = null.x) {} f(); // Throws an exception
Currently, it does not because defaults are evaluated in the body of the generator.
The same applies to async generator functions.
The text was updated successfully, but these errors were encountered:
I think async function could just return a rejected promise. The only important thing is the timing.
function *g(a = A()) { console.log(11) yield a console.log(12) } const it = g() console.log(10) while (!it.next().done) {} async function af(a = A()) { console.log(20) await Promise.resolve(a) console.log(22) } af().then(_ => console.log(23), _ => console.log(24)) console.log(21) function A() { console.log('ok') return 'a' }
babel output:
ok 10 11 12 ok 20 21 22 23
traceur (0.0.62) output
10 ok 11 12 ok 20 21 22 23
esdown output:
10 ok 11 12 ok 20 21 24
Sorry, something went wrong.
@hax Ah, that's a different translation bug (#21). Thanks for the report!
No branches or pull requests
Errors which occur during parameter binding and evaluation should result in exceptions.
Currently, it does not because defaults are evaluated in the body of the generator.
The same applies to async generator functions.
The text was updated successfully, but these errors were encountered: