-
Notifications
You must be signed in to change notification settings - Fork 0
Disallow using/await using in a switch case/default clause #14
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
Disallow using/await using in a switch case/default clause #14
Conversation
@dminor: do you want to add this to your agenda topic, or should I create a separate one? |
I'll add a slide with this PR and a request for consensus for the change. |
@rbuckton Thank you for putting this together. |
Note that V8 and Chrome have already shipped, but we are still supportive of this change and will change our implementation. I highly doubt people rely on this in the wild. |
Moddable has implemented the currently defined behavior in XS. We agree that using case this way is obscure, at best, and are willing to update XS to support this proposed change. |
SpiderMonkey has implemented the current specification, but we haven't shipped it yet. We're also willing to change our implementation. |
This CL disallows `using` and `await using` in switch cases. This was a normative change that got consensus in TC39 meetings: rbuckton/ecma262#14 Bug: 409478039 Change-Id: I077e75d7d0d632c8b34150cfc76e4903984d6091 Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/6500234 Reviewed-by: Shu-yu Guo <syg@chromium.org> Commit-Queue: Rezvan Mahdavi Hezaveh <rezvan@chromium.org> Cr-Commit-Position: refs/heads/main@{#100037}
Original commit message: [explicit-resource-management] disallow using in switch cases This CL disallows `using` and `await using` in switch cases. This was a normative change that got consensus in TC39 meetings: rbuckton/ecma262#14 Bug: 409478039 Change-Id: I077e75d7d0d632c8b34150cfc76e4903984d6091 Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/6500234 Reviewed-by: Shu-yu Guo <syg@chromium.org> Commit-Queue: Rezvan Mahdavi Hezaveh <rezvan@chromium.org> Cr-Commit-Position: refs/heads/main@{#100037} Refs: v8/v8@044b9b6
Original commit message: [explicit-resource-management] disallow using in switch cases This CL disallows `using` and `await using` in switch cases. This was a normative change that got consensus in TC39 meetings: rbuckton/ecma262#14 Bug: 409478039 Change-Id: I077e75d7d0d632c8b34150cfc76e4903984d6091 Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/6500234 Reviewed-by: Shu-yu Guo <syg@chromium.org> Commit-Queue: Rezvan Mahdavi Hezaveh <rezvan@chromium.org> Cr-Commit-Position: refs/heads/main@{#100037} Refs: v8/v8@044b9b6 PR-URL: #58230 Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com> Reviewed-By: Richard Lau <rlau@redhat.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Marco Ippolito <marcoippolito54@gmail.com> Reviewed-By: Juan José Arboleda <soyjuanarbol@gmail.com> Reviewed-By: Chengzhong Wu <legendecas@gmail.com>
Original commit message: [explicit-resource-management] disallow using in switch cases This CL disallows `using` and `await using` in switch cases. This was a normative change that got consensus in TC39 meetings: rbuckton/ecma262#14 Bug: 409478039 Change-Id: I077e75d7d0d632c8b34150cfc76e4903984d6091 Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/6500234 Reviewed-by: Shu-yu Guo <syg@chromium.org> Commit-Queue: Rezvan Mahdavi Hezaveh <rezvan@chromium.org> Cr-Commit-Position: refs/heads/main@{#100037} Refs: v8/v8@044b9b6 PR-URL: #58230 Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com> Reviewed-By: Richard Lau <rlau@redhat.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Marco Ippolito <marcoippolito54@gmail.com> Reviewed-By: Juan José Arboleda <soyjuanarbol@gmail.com> Reviewed-By: Chengzhong Wu <legendecas@gmail.com>
Original commit message: [explicit-resource-management] disallow using in switch cases This CL disallows `using` and `await using` in switch cases. This was a normative change that got consensus in TC39 meetings: rbuckton/ecma262#14 Bug: 409478039 Change-Id: I077e75d7d0d632c8b34150cfc76e4903984d6091 Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/6500234 Reviewed-by: Shu-yu Guo <syg@chromium.org> Commit-Queue: Rezvan Mahdavi Hezaveh <rezvan@chromium.org> Cr-Commit-Position: refs/heads/main@{#100037} Refs: v8/v8@044b9b6 PR-URL: nodejs#58230 Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com> Reviewed-By: Richard Lau <rlau@redhat.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Marco Ippolito <marcoippolito54@gmail.com> Reviewed-By: Juan José Arboleda <soyjuanarbol@gmail.com> Reviewed-By: Chengzhong Wu <legendecas@gmail.com>
Original commit message: [explicit-resource-management] disallow using in switch cases This CL disallows `using` and `await using` in switch cases. This was a normative change that got consensus in TC39 meetings: rbuckton/ecma262#14 Bug: 409478039 Change-Id: I077e75d7d0d632c8b34150cfc76e4903984d6091 Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/6500234 Reviewed-by: Shu-yu Guo <syg@chromium.org> Commit-Queue: Rezvan Mahdavi Hezaveh <rezvan@chromium.org> Cr-Commit-Position: refs/heads/main@{#100037} Refs: v8/v8@044b9b6 PR-URL: #58230 Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com> Reviewed-By: Richard Lau <rlau@redhat.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Marco Ippolito <marcoippolito54@gmail.com> Reviewed-By: Juan José Arboleda <soyjuanarbol@gmail.com> Reviewed-By: Chengzhong Wu <legendecas@gmail.com> PR-URL: #58064 Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com> Reviewed-By: Darshan Sen <raisinten@gmail.com> Reviewed-By: Paolo Insogna <paolo@cowtech.it> Reviewed-By: Yagiz Nizipli <yagiz@nizipli.com>
As requested by implementers, this disallows
using
/await using
directly nested within acase
ordefault
clause. This also removes some of the logic inHasCallInTailPosition
andHasUnterminatedUsingDeclaration
that pertain tocase
anddefault
asHasUnterminatedUsingDeclaration
would no longer apply.Fixes tc39/proposal-explicit-resource-management#215
/cc @syg, @iainireland, @waldemarhorwat