Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: d8f1247323f192b8107470b9d8816734d8934f66
      
https://github.com/WebKit/WebKit/commit/d8f1247323f192b8107470b9d8816734d8934f66
  Author: Ross Kirsling <ross.kirsl...@sony.com>
  Date:   2025-04-22 (Tue, 22 Apr 2025)

  Changed paths:
    M JSTests/ChakraCore/test/Function/call1.baseline-jsc
    M JSTests/ChakraCore/test/LetConst/tdz1.baseline-jsc
    A JSTests/stress/sloppy-mode-function-call-assignment-targets.js
    M LayoutTests/js/modify-non-references-expected.txt
    M LayoutTests/js/parser-syntax-check-expected.txt
    M LayoutTests/js/script-tests/modify-non-references.js
    M LayoutTests/svg/dom/SVGTransformList-anim-read-only-expected.txt
    M Source/JavaScriptCore/bytecompiler/NodesCodegen.cpp
    M Source/JavaScriptCore/parser/ASTBuilder.h
    M Source/JavaScriptCore/parser/NodeConstructors.h
    M Source/JavaScriptCore/parser/Nodes.h
    M Source/JavaScriptCore/parser/Parser.cpp

  Log Message:
  -----------
  [JSC] Align sloppy mode `f() = 1` behavior with other engines
https://bugs.webkit.org/show_bug.cgi?id=291882

Reviewed by Yusuke Suzuki.

In tc39/ecma262#3568, we'll finally be specifying the web reality that `f() = 
1` is not an early error in sloppy mode.
JSC's behavior on this was mostly aligned with SM/V8's back in 
https://commits.webkit.org/212076@main,
but there is one outstanding discrepancy to resolve: SM/V8 both call the 
function before throwing a ReferenceError.

This patch resolves said discrepancy, which applies to not only =, but also += 
and kin (excluding logical assignment),
++ / --, and for-in/of.

* JSTests/ChakraCore/test/Function/call1.baseline-jsc:
* JSTests/ChakraCore/test/LetConst/tdz1.baseline-jsc:
* JSTests/stress/sloppy-mode-function-call-assignment-targets.js: Added.
* LayoutTests/js/modify-non-references-expected.txt:
* LayoutTests/js/parser-syntax-check-expected.txt:
* LayoutTests/js/script-tests/modify-non-references.js:
* LayoutTests/svg/dom/SVGTransformList-anim-read-only-expected.txt:
* Source/JavaScriptCore/bytecompiler/NodesCodegen.cpp:
(JSC::PostfixNode::emitBytecode):
(JSC::PrefixNode::emitBytecode):
(JSC::AssignErrorNode::emitBytecode):
(JSC::ForInNode::emitBytecode):
(JSC::ForOfNode::emitBytecode):
* Source/JavaScriptCore/parser/ASTBuilder.h:
(JSC::ASTBuilder::makeAssignNode):
* Source/JavaScriptCore/parser/NodeConstructors.h:
(JSC::AssignErrorNode::AssignErrorNode):
* Source/JavaScriptCore/parser/Nodes.h:
* Source/JavaScriptCore/parser/Parser.cpp:
(JSC::Parser<LexerType>::isSimpleAssignmentTarget):

Canonical link: https://commits.webkit.org/293996@main



To unsubscribe from these emails, change your notification settings at 
https://github.com/WebKit/WebKit/settings/notifications
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to