netbeans
netbeans copied to clipboard
JavaScript to support "for await of"
Description
As a javacript developer I would like to have support for for await...of (ECMAScript specification) so that I can write asynchronous iterators using the for keyword.
Taken from the MDN for await...of example, the following for await statement uses an asynchronous iterator to produce its output
async function* foo() {
yield 1;
yield 2;
}
(async function() {
for await (const num of foo()) {
console.log(num); // expected output: 1
break; // closes iterator, triggers return
}
})();
Presently this produces the following error message:
Expected ( but found await
Use case/motivation
Working with NodeJS applications such as AWS Lambda works with a lot of async code. Having native support for this within NetBeans IDE provides a better developer experience.
I am willing to contribute with guidance.
Related issues
No response
Are you willing to submit a pull request?
Yes
Code of Conduct
Yes