Branch: refs/heads/main
Home: https://github.com/WebKit/WebKit
Commit: edb17fbf37d3f64446ecb9be891d829828015350
https://github.com/WebKit/WebKit/commit/edb17fbf37d3f64446ecb9be891d829828015350
Author: Sosuke Suzuki <[email protected]>
Date: 2026-10-05 (Mon, 05 Oct 2026)
Changed paths:
A JSTests/stress/catch-parameter-await.js
M Source/JavaScriptCore/parser/Parser.cpp
Log Message:
-----------
[JSC] Reject a catch parameter named 'await' where 'await' is not an
identifier
https://bugs.webkit.org/show_bug.cgi?id=325957
Reviewed by Yusuke Suzuki.
`catch (await)` was accepted in async functions and module code, and
`catch (\u0061wait)` was accepted even in class static blocks. These are
early errors because CatchParameter is BindingIdentifier[?Yield, ?Await].
The simple catch parameter path in parseTryStatement() did not call
isDisallowedIdentifierAwait() unlike the other binding sites. Call it there,
and remove the static block check that it makes redundant.
Test: JSTests/stress/catch-parameter-await.js
* JSTests/stress/catch-parameter-await.js: Added.
(shouldBe):
(shouldThrowSyntaxError):
(shouldParse):
(const.AsyncFunction):
(async const.AsyncGeneratorFunction):
(async const.GeneratorFunction):
(sourcesFor):
(shouldReject):
(shouldAccept):
(async shouldReject):
(parseEvalCodeInAsyncFunction.async if):
(parseEvalCodeInAsyncFunction):
(async const):
(get shouldAccept):
(async shouldAccept):
(async shouldThrowSyntaxError):
* Source/JavaScriptCore/parser/Parser.cpp:
(JSC::Parser<LexerType>::parseTryStatement):
Canonical link: https://commits.webkit.org/322702@main
To unsubscribe from these emails, change your notification settings at
https://github.com/WebKit/WebKit/settings/notifications