Branch: refs/heads/main
Home: https://github.com/WebKit/WebKit
Commit: 49e7f6c0c1d5ed9f7bca1f5b7930946e50865a5f
https://github.com/WebKit/WebKit/commit/49e7f6c0c1d5ed9f7bca1f5b7930946e50865a5f
Author: Sosuke Suzuki <[email protected]>
Date: 2025-05-24 (Sat, 24 May 2025)
Changed paths:
A JSTests/stress/yield-function-name-syntax-error-strict.js
M JSTests/stress/yield-named-variable.js
M JSTests/test262/expectations.yaml
M Source/JavaScriptCore/parser/Parser.cpp
Log Message:
-----------
[JSC] Functions named yield in strict mode is invalid
https://bugs.webkit.org/show_bug.cgi?id=292190
Reviewed by Yusuke Suzuki.
According to the spce[1], SyntaxError should be thrown for functions
named yield in strict mode.
However we don't throw SyntaxError for functions with `use strict`
directive in their body.
This patch changes to fix it.
[1]: https://tc39.es/ecma262/#sec-identifiers-static-semantics-early-errors
* JSTests/stress/yield-function-name-syntax-error-strict.js: Added.
(shouldThrowSyntaxError):
* Source/JavaScriptCore/parser/Parser.cpp:
(JSC::Parser<LexerType>::parseFunctionInfo):
Canonical link: https://commits.webkit.org/295402@main
To unsubscribe from these emails, change your notification settings at
https://github.com/WebKit/WebKit/settings/notifications
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes