You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
So a YieldExpression and AwaitExpression should not be valid in a class initializer.
Here is an example to illustrate the issue:
asyncfunctionf(p){returnclassC{x=awaitp;// when could this possibly be awaited?};}letC=awaitf(Promise.resolve(1));letobj=newC();obj.x;// what is this value?
It seems to me that Initializer[+In, ?Yield, ?Await] should be Initializer[+In, ~Yield, ~Await].
The text was updated successfully, but these errors were encountered:
Per the current spec:
This passes along the
Yield
andAwait
parameters to Initializer, which seems incorrect. A class field is wrapped in an implicit function, per https://tc39.es/ecma262/#sec-runtime-semantics-classfielddefinitionevaluation, step 3.e:So a YieldExpression and AwaitExpression should not be valid in a class initializer.
Here is an example to illustrate the issue:
It seems to me that
Initializer[+In, ?Yield, ?Await]
should beInitializer[+In, ~Yield, ~Await]
.The text was updated successfully, but these errors were encountered: