From f43f508513af29e9b9a5dedc492abf4fd53292cd Mon Sep 17 00:00:00 2001 From: Archkon <180910180+Archkon@users.noreply.github.com> Date: Sun, 28 Sep 2025 00:47:19 +0800 Subject: [PATCH] replace invalid JS according to newest spec which will cause SyntaxError: The left-hand side of a for-of loop may not be 'async' refer to https://tc39.es/ecma262/#sec-for-in-and-for-of-statements --- js-quirks.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/js-quirks.md b/js-quirks.md index 20c621c92..5ecf27a70 100644 --- a/js-quirks.md +++ b/js-quirks.md @@ -360,11 +360,11 @@ to make it a little less confusing.) Amazingly, both of the following are valid JS code: ```js - for (async of => {};;) {} - for (async of []) {} + for (using of = resource;;) {} + for (using of []) {} ``` - In the first line, `async` is a keyword and `of` is an identifier; + In the first line, `using` is a keyword and `of` is an identifier; in the second line it's the other way round. Even a simplified JS grammar can't be LR(1) as long as it includes