-
-
Notifications
You must be signed in to change notification settings - Fork 3.2k
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
LibJS/Bytecode: Implement async generators #19934
Conversation
9e7ea1d
to
d822f56
Compare
Couple of high level questions without getting into the diff: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
bytecode changes mostly LGTM, just one comment about a comment:
Seems like a spec bug to me. In bytecode mode, the crashes are:
These are asserting on infallible invocations to // ii. Perform ! AsyncGeneratorAwaitReturn(generator).
MUST(await_return()); However this operation is trivially fallible in step 6: // 6. Let promise be ? PromiseResolve(%Promise%, completion.[[Value]]).
auto* promise = TRY(promise_resolve(vm, realm.intrinsics().promise_constructor(), completion.value().value())); The current form of this AO was written here. Before that, abrupt completions from |
Ah there's a spec PR open for this already: tc39/ecma262#2683 |
Previously it returned a rejected promise, which is not correct: https://tc39.es/ecma262/#sec-runtime-semantics-evaluateasyncgeneratorbody ``` 1. Perform ? FunctionDeclarationInstantiation(functionObject, argumentsList). ```
d822f56
to
abd839a
Compare
All comments addressed except the 1 AST crash, which is:
Though I don't know if it's worth fixing this given that AST's |
abd839a
to
9072b70
Compare
Bytecode diff:
Tests passing: 47122/49388 (95.4%)
AST diff:
Tests passing: 47322/49388 (95.8%)
https://www.youtube.com/watch?v=_ovdm2yX4MA