-
Notifications
You must be signed in to change notification settings - Fork 489
[explicit-resource-management] Add remaining tests specific to await using
statement syntax
#4481
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
base: main
Are you sure you want to change the base?
[explicit-resource-management] Add remaining tests specific to await using
statement syntax
#4481
Conversation
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.
I learned a lot reviewing this PR. Thanks!
// This code is governed by the BSD license found in the LICENSE file. | ||
|
||
/*--- | ||
esid: pending |
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.
I don't think we should block the PR on this, but if you do have a chance I'd appreciate it if you could replace pending
with the relevant HTML section anchor throughout the PR.
|
||
$DONOTEVALUATE(); | ||
async function f() { | ||
await using x = null, y; |
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.
I was confused about where this is prohibited, but I figured it out eventually: it's in IsConstantDeclaration. Not a big deal, but it might be helpful to include that in the description
or info
in this and the following few tests.
asyncTest(async function () { | ||
await assert.throwsAsync(TypeError, async function() { | ||
for (await using i = 0; i < 1; i++) {} | ||
}); | ||
}); |
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.
Should this not result in a SyntaxError, due to https://tc39.es/ecma262/#sec-let-and-const-declarations-static-semantics-early-errors?
/*--- | ||
esid: pending | ||
description: > | ||
await using: invalid assignment in Statement body |
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.
It'd be good to note in the info
that the error is thrown in CreateDisposableResource
In an effort to make review more manageable, this extracts the remaining tests specific to
await using
statement syntax from #3866