Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: b8cb1ca3b5f0debf343a81accdd77cffe07622f5
      
https://github.com/WebKit/WebKit/commit/b8cb1ca3b5f0debf343a81accdd77cffe07622f5
  Author: Sosuke Suzuki <[email protected]>
  Date:   2024-04-16 (Tue, 16 Apr 2024)

  Changed paths:
    M JSTests/stress/bytecode-for-rmw-with-invalid-right-side.js
    A JSTests/stress/logical-assignment-with-func-call-lhs.js
    M JSTests/test262/expectations.yaml
    M Source/JavaScriptCore/parser/Parser.cpp
    M Source/JavaScriptCore/parser/Parser.h

  Log Message:
  -----------
  [JSC] Syntax error should be thrown for logical assignment expressions where 
the LHS is a function call.
https://bugs.webkit.org/show_bug.cgi?id=272524

Reviewed by Alexey Shvayka.

JSC throws a Reference Error instead of a Syntax Error for logical assignment 
expressions where the LHS is a function call in sloppy mode. According to the 
commit[2] when logical assignment expressions were implemented in JSC, this was 
intentional. However, four years have passed, and the related specification has 
not been updated, while other JS engines throw a Syntax Error.

This patch changes the behavior to throw a Syntax Error for such logical 
assignment expressions even in sloppy mode.

[1]: 
https://tc39.es/ecma262/#sec-assignment-operators-static-semantics-early-errors
[2]: https://commits.webkit.org/223412@main

* JSTests/stress/bytecode-for-rmw-with-invalid-right-side.js:
* JSTests/stress/logical-assignment-with-func-call-lhs.js: Added.
(shouldThrowSyntaxError):
* JSTests/test262/expectations.yaml:
* Source/JavaScriptCore/parser/Parser.cpp:
(JSC::Parser<LexerType>::isSimpleAssignmentTarget):
(JSC::Parser<LexerType>::parseAssignmentExpression):
* Source/JavaScriptCore/parser/Parser.h:

Canonical link: https://commits.webkit.org/277536@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

Reply via email to