diff --git a/src/assignment-target-type/callexpression-arguments.case b/src/assignment-target-type/callexpression-arguments.case deleted file mode 100644 index b97cb8c660..0000000000 --- a/src/assignment-target-type/callexpression-arguments.case +++ /dev/null @@ -1,22 +0,0 @@ -// Copyright (C) 2020 Rick Waldron. All rights reserved. -// This code is governed by the BSD license found in the LICENSE file. - -/*--- -esid: sec-static-semantics-static-semantics-assignmenttargettype -desc: > - Static Semantics AssignmentTargetType, Return invalid. -info: | - CallExpression Arguments - Static Semantics AssignmentTargetType, Return invalid. -template: invalid -negative: - phase: parse - type: SyntaxError ----*/ - -//- assignmenttarget -f() -//- operator -= -//- value -1 diff --git a/src/assignment-target-type/callexpression-as-for-in-lhs.case b/src/assignment-target-type/callexpression-as-for-in-lhs.case new file mode 100644 index 0000000000..054a5ba052 --- /dev/null +++ b/src/assignment-target-type/callexpression-as-for-in-lhs.case @@ -0,0 +1,23 @@ +// Copyright (C) 2025 Sony Interactive Entertainment Inc. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-static-semantics-static-semantics-assignmenttargettype +desc: > + Static Semantics AssignmentTargetType, Return web-compat. +info: | + CallExpression : + CoverCallExpressionAndAsyncArrowHead + CallExpression Arguments + 1. If the host is a web browser or otherwise supports Runtime Errors for Function Call Assignment Targets, then + a. If IsStrict(this CallExpression) is false, return ~web-compat~. + 2. Return ~invalid~. +template: invalid/statement +negative: + phase: parse + type: SyntaxError +flags: [onlyStrict] +---*/ + +//- statement +for (f() in [1]) {} diff --git a/src/assignment-target-type/callexpression-as-for-of-lhs.case b/src/assignment-target-type/callexpression-as-for-of-lhs.case new file mode 100644 index 0000000000..a4311cf764 --- /dev/null +++ b/src/assignment-target-type/callexpression-as-for-of-lhs.case @@ -0,0 +1,23 @@ +// Copyright (C) 2025 Sony Interactive Entertainment Inc. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-static-semantics-static-semantics-assignmenttargettype +desc: > + Static Semantics AssignmentTargetType, Return web-compat. +info: | + CallExpression : + CoverCallExpressionAndAsyncArrowHead + CallExpression Arguments + 1. If the host is a web browser or otherwise supports Runtime Errors for Function Call Assignment Targets, then + a. If IsStrict(this CallExpression) is false, return ~web-compat~. + 2. Return ~invalid~. +template: invalid/statement +negative: + phase: parse + type: SyntaxError +flags: [onlyStrict] +---*/ + +//- statement +for (f() of [1]) {} diff --git a/src/assignment-target-type/callexpression-in-compound-assignment.case b/src/assignment-target-type/callexpression-in-compound-assignment.case new file mode 100644 index 0000000000..69e84f4a9c --- /dev/null +++ b/src/assignment-target-type/callexpression-in-compound-assignment.case @@ -0,0 +1,27 @@ +// Copyright (C) 2025 Sony Interactive Entertainment Inc. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-static-semantics-static-semantics-assignmenttargettype +desc: > + Static Semantics AssignmentTargetType, Return web-compat. +info: | + CallExpression : + CoverCallExpressionAndAsyncArrowHead + CallExpression Arguments + 1. If the host is a web browser or otherwise supports Runtime Errors for Function Call Assignment Targets, then + a. If IsStrict(this CallExpression) is false, return ~web-compat~. + 2. Return ~invalid~. +template: invalid +negative: + phase: parse + type: SyntaxError +flags: [onlyStrict] +---*/ + +//- assignmenttarget +f() +//- operator ++= +//- value +1 diff --git a/src/assignment-target-type/callexpression-in-logical-assignment.case b/src/assignment-target-type/callexpression-in-logical-assignment.case new file mode 100644 index 0000000000..34602b1e11 --- /dev/null +++ b/src/assignment-target-type/callexpression-in-logical-assignment.case @@ -0,0 +1,26 @@ +// Copyright (C) 2025 Sony Interactive Entertainment Inc. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-static-semantics-static-semantics-assignmenttargettype +desc: > + Static Semantics AssignmentTargetType, Return web-compat. +info: | + CallExpression : + CoverCallExpressionAndAsyncArrowHead + CallExpression Arguments + 1. If the host is a web browser or otherwise supports Runtime Errors for Function Call Assignment Targets, then + a. If IsStrict(this CallExpression) is false, return ~web-compat~. + 2. Return ~invalid~. +template: invalid +negative: + phase: parse + type: SyntaxError +---*/ + +//- assignmenttarget +f() +//- operator +&&= +//- value +1 diff --git a/src/assignment-target-type/callexpression-in-postfix-update.case b/src/assignment-target-type/callexpression-in-postfix-update.case new file mode 100644 index 0000000000..b99430be5f --- /dev/null +++ b/src/assignment-target-type/callexpression-in-postfix-update.case @@ -0,0 +1,23 @@ +// Copyright (C) 2025 Sony Interactive Entertainment Inc. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-static-semantics-static-semantics-assignmenttargettype +desc: > + Static Semantics AssignmentTargetType, Return web-compat. +info: | + CallExpression : + CoverCallExpressionAndAsyncArrowHead + CallExpression Arguments + 1. If the host is a web browser or otherwise supports Runtime Errors for Function Call Assignment Targets, then + a. If IsStrict(this CallExpression) is false, return ~web-compat~. + 2. Return ~invalid~. +template: invalid/statement +negative: + phase: parse + type: SyntaxError +flags: [onlyStrict] +---*/ + +//- statement +f()++; diff --git a/src/assignment-target-type/callexpression-in-prefix-update.case b/src/assignment-target-type/callexpression-in-prefix-update.case new file mode 100644 index 0000000000..ec8bc7e3ae --- /dev/null +++ b/src/assignment-target-type/callexpression-in-prefix-update.case @@ -0,0 +1,23 @@ +// Copyright (C) 2025 Sony Interactive Entertainment Inc. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-static-semantics-static-semantics-assignmenttargettype +desc: > + Static Semantics AssignmentTargetType, Return web-compat. +info: | + CallExpression : + CoverCallExpressionAndAsyncArrowHead + CallExpression Arguments + 1. If the host is a web browser or otherwise supports Runtime Errors for Function Call Assignment Targets, then + a. If IsStrict(this CallExpression) is false, return ~web-compat~. + 2. Return ~invalid~. +template: invalid/statement +negative: + phase: parse + type: SyntaxError +flags: [onlyStrict] +---*/ + +//- statement +++f(); diff --git a/src/assignment-target-type/callexpression.case b/src/assignment-target-type/callexpression.case new file mode 100644 index 0000000000..482c268dcb --- /dev/null +++ b/src/assignment-target-type/callexpression.case @@ -0,0 +1,28 @@ +// Copyright (C) 2020 Rick Waldron. All rights reserved. +// Copyright (C) 2025 Sony Interactive Entertainment Inc. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-static-semantics-static-semantics-assignmenttargettype +desc: > + Static Semantics AssignmentTargetType, Return web-compat. +info: | + CallExpression : + CoverCallExpressionAndAsyncArrowHead + CallExpression Arguments + 1. If the host is a web browser or otherwise supports Runtime Errors for Function Call Assignment Targets, then + a. If IsStrict(this CallExpression) is false, return ~web-compat~. + 2. Return ~invalid~. +template: invalid +negative: + phase: parse + type: SyntaxError +flags: [onlyStrict] +---*/ + +//- assignmenttarget +f() +//- operator += +//- value +1 diff --git a/src/assignment-target-type/invalid/iteration/direct.template b/src/assignment-target-type/invalid/iteration/direct.template deleted file mode 100644 index 3f58f2ed5b..0000000000 --- a/src/assignment-target-type/invalid/iteration/direct.template +++ /dev/null @@ -1,15 +0,0 @@ -// Copyright (C) 2020 Rick Waldron. All rights reserved. -// This code is governed by the BSD license found in the LICENSE file. - -/*--- -path: language/expressions/assignmenttargettype/iteration-direct- -name: Direct assignment -info: | - Direct assignment ----*/ -$DONOTEVALUATE(); - -function _() { - for (/*{ assignmenttarget }*/ /*{ operator }*/ /*{ value }*/) {} -} - diff --git a/src/assignment-target-type/invalid/statement/default.template b/src/assignment-target-type/invalid/statement/default.template new file mode 100644 index 0000000000..3b5adfe0f0 --- /dev/null +++ b/src/assignment-target-type/invalid/statement/default.template @@ -0,0 +1,12 @@ +// Copyright (C) 2025 Sony Interactive Entertainment Inc. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +path: language/expressions/assignmenttargettype/direct- +name: Direct assignment +info: | + Direct assignment +---*/ +$DONOTEVALUATE(); + +/*{ statement }*/ diff --git a/test/annexB/language/expressions/assignmenttargettype/callexpression-as-for-in-lhs.js b/test/annexB/language/expressions/assignmenttargettype/callexpression-as-for-in-lhs.js new file mode 100644 index 0000000000..b270ad2ecd --- /dev/null +++ b/test/annexB/language/expressions/assignmenttargettype/callexpression-as-for-in-lhs.js @@ -0,0 +1,31 @@ +// Copyright (C) 2025 Sony Interactive Entertainment Inc. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-runtime-errors-for-function-call-assignment-targets +description: Function call as for-in LHS is a runtime ReferenceError +info: | + CallExpression : + CoverCallExpressionAndAsyncArrowHead + CallExpression Arguments + 1. If the host is a web browser or otherwise supports Runtime Errors for Function Call Assignment Targets, then + a. If IsStrict(this CallExpression) is false, return ~web-compat~. + 2. Return ~invalid~. +flags: [noStrict] +---*/ + +var fCalled = false; +var fValueOfCalled = false; +function f() { + fCalled = true; + return { + valueOf() { fValueOfCalled = true; return 1; } + }; +} + +assert.throws(ReferenceError, function() { + for (f() in [1]) {} +}); + +assert(fCalled); +assert(!fValueOfCalled); diff --git a/test/annexB/language/expressions/assignmenttargettype/callexpression-as-for-of-lhs.js b/test/annexB/language/expressions/assignmenttargettype/callexpression-as-for-of-lhs.js new file mode 100644 index 0000000000..78394a0b47 --- /dev/null +++ b/test/annexB/language/expressions/assignmenttargettype/callexpression-as-for-of-lhs.js @@ -0,0 +1,31 @@ +// Copyright (C) 2025 Sony Interactive Entertainment Inc. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-runtime-errors-for-function-call-assignment-targets +description: Function call as for-of LHS is a runtime ReferenceError +info: | + CallExpression : + CoverCallExpressionAndAsyncArrowHead + CallExpression Arguments + 1. If the host is a web browser or otherwise supports Runtime Errors for Function Call Assignment Targets, then + a. If IsStrict(this CallExpression) is false, return ~web-compat~. + 2. Return ~invalid~. +flags: [noStrict] +---*/ + +var fCalled = false; +var fValueOfCalled = false; +function f() { + fCalled = true; + return { + valueOf() { fValueOfCalled = true; return 1; } + }; +} + +assert.throws(ReferenceError, function() { + for (f() of [1]) {} +}); + +assert(fCalled); +assert(!fValueOfCalled); diff --git a/test/annexB/language/expressions/assignmenttargettype/callexpression-in-compound-assignment.js b/test/annexB/language/expressions/assignmenttargettype/callexpression-in-compound-assignment.js new file mode 100644 index 0000000000..b526300c90 --- /dev/null +++ b/test/annexB/language/expressions/assignmenttargettype/callexpression-in-compound-assignment.js @@ -0,0 +1,38 @@ +// Copyright (C) 2025 Sony Interactive Entertainment Inc. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-runtime-errors-for-function-call-assignment-targets +description: Function call LHS in compound assignment is a runtime ReferenceError +info: | + CallExpression : + CoverCallExpressionAndAsyncArrowHead + CallExpression Arguments + 1. If the host is a web browser or otherwise supports Runtime Errors for Function Call Assignment Targets, then + a. If IsStrict(this CallExpression) is false, return ~web-compat~. + 2. Return ~invalid~. +flags: [noStrict] +---*/ + +var fCalled = false; +var fValueOfCalled = false; +function f() { + fCalled = true; + return { + valueOf() { fValueOfCalled = true; return 1; } + }; +} + +var gCalled = false; +function g() { + gCalled = true; + return 1; +} + +assert.throws(ReferenceError, function() { + f() += g(); +}); + +assert(fCalled); +assert(!fValueOfCalled); +assert(!gCalled); diff --git a/test/annexB/language/expressions/assignmenttargettype/callexpression-in-postfix-update.js b/test/annexB/language/expressions/assignmenttargettype/callexpression-in-postfix-update.js new file mode 100644 index 0000000000..a108c6d382 --- /dev/null +++ b/test/annexB/language/expressions/assignmenttargettype/callexpression-in-postfix-update.js @@ -0,0 +1,31 @@ +// Copyright (C) 2025 Sony Interactive Entertainment Inc. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-runtime-errors-for-function-call-assignment-targets +description: Function call in postfix update expression is a runtime ReferenceError +info: | + CallExpression : + CoverCallExpressionAndAsyncArrowHead + CallExpression Arguments + 1. If the host is a web browser or otherwise supports Runtime Errors for Function Call Assignment Targets, then + a. If IsStrict(this CallExpression) is false, return ~web-compat~. + 2. Return ~invalid~. +flags: [noStrict] +---*/ + +var fCalled = false; +var fValueOfCalled = false; +function f() { + fCalled = true; + return { + valueOf() { fValueOfCalled = true; return 1; } + }; +} + +assert.throws(ReferenceError, function() { + f()++; +}); + +assert(fCalled); +assert(!fValueOfCalled); diff --git a/test/annexB/language/expressions/assignmenttargettype/callexpression-in-prefix-update.js b/test/annexB/language/expressions/assignmenttargettype/callexpression-in-prefix-update.js new file mode 100644 index 0000000000..9a4fd71aec --- /dev/null +++ b/test/annexB/language/expressions/assignmenttargettype/callexpression-in-prefix-update.js @@ -0,0 +1,31 @@ +// Copyright (C) 2025 Sony Interactive Entertainment Inc. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-runtime-errors-for-function-call-assignment-targets +description: Function call in prefix update expression is a runtime ReferenceError +info: | + CallExpression : + CoverCallExpressionAndAsyncArrowHead + CallExpression Arguments + 1. If the host is a web browser or otherwise supports Runtime Errors for Function Call Assignment Targets, then + a. If IsStrict(this CallExpression) is false, return ~web-compat~. + 2. Return ~invalid~. +flags: [noStrict] +---*/ + +var fCalled = false; +var fValueOfCalled = false; +function f() { + fCalled = true; + return { + valueOf() { fValueOfCalled = true; return 1; } + }; +} + +assert.throws(ReferenceError, function() { + ++f(); +}); + +assert(fCalled); +assert(!fValueOfCalled); diff --git a/test/annexB/language/expressions/assignmenttargettype/callexpression.js b/test/annexB/language/expressions/assignmenttargettype/callexpression.js new file mode 100644 index 0000000000..1df257ffec --- /dev/null +++ b/test/annexB/language/expressions/assignmenttargettype/callexpression.js @@ -0,0 +1,38 @@ +// Copyright (C) 2025 Sony Interactive Entertainment Inc. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-runtime-errors-for-function-call-assignment-targets +description: Function call LHS in `=` assignment is a runtime ReferenceError +info: | + CallExpression : + CoverCallExpressionAndAsyncArrowHead + CallExpression Arguments + 1. If the host is a web browser or otherwise supports Runtime Errors for Function Call Assignment Targets, then + a. If IsStrict(this CallExpression) is false, return ~web-compat~. + 2. Return ~invalid~. +flags: [noStrict] +---*/ + +var fCalled = false; +var fValueOfCalled = false; +function f() { + fCalled = true; + return { + valueOf() { fValueOfCalled = true; return 1; } + }; +} + +var gCalled = false; +function g() { + gCalled = true; + return 1; +} + +assert.throws(ReferenceError, function() { + f() = g(); +}); + +assert(fCalled); +assert(!fValueOfCalled); +assert(!gCalled); diff --git a/test/annexB/language/expressions/assignmenttargettype/cover-callexpression-and-asyncarrowhead.js b/test/annexB/language/expressions/assignmenttargettype/cover-callexpression-and-asyncarrowhead.js new file mode 100644 index 0000000000..ae7915b4dd --- /dev/null +++ b/test/annexB/language/expressions/assignmenttargettype/cover-callexpression-and-asyncarrowhead.js @@ -0,0 +1,41 @@ +// Copyright (C) 2025 Sony Interactive Entertainment Inc. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-runtime-errors-for-function-call-assignment-targets +description: Function call assignment target is still a runtime ReferenceError when the function is named `async` +info: | + CallExpression : + CoverCallExpressionAndAsyncArrowHead + CallExpression Arguments + 1. If the host is a web browser or otherwise supports Runtime Errors for Function Call Assignment Targets, then + a. If IsStrict(this CallExpression) is false, return ~web-compat~. + 2. Return ~invalid~. +flags: [noStrict] +---*/ + +function async() {} + +assert.throws(ReferenceError, function() { + async() = 1; +}); + +assert.throws(ReferenceError, function() { + async() += 1; +}); + +assert.throws(ReferenceError, function() { + async()++; +}); + +assert.throws(ReferenceError, function() { + ++async(); +}); + +assert.throws(ReferenceError, function() { + for (async() in [1]) {} +}); + +assert.throws(ReferenceError, function() { + for (async() of [1]) {} +}); diff --git a/test/language/expressions/assignmenttargettype/direct-callexpression-arguments.js b/test/language/expressions/assignmenttargettype/direct-callexpression-arguments.js deleted file mode 100644 index 8dabcc25f1..0000000000 --- a/test/language/expressions/assignmenttargettype/direct-callexpression-arguments.js +++ /dev/null @@ -1,20 +0,0 @@ -// This file was procedurally generated from the following sources: -// - src/assignment-target-type/callexpression-arguments.case -// - src/assignment-target-type/invalid/direct.template -/*--- -description: Static Semantics AssignmentTargetType, Return invalid. (Direct assignment) -flags: [generated] -negative: - phase: parse - type: SyntaxError -info: | - Direct assignment - - CallExpression Arguments - Static Semantics AssignmentTargetType, Return invalid. - ----*/ - -$DONOTEVALUATE(); - -f() = 1; diff --git a/test/language/expressions/assignmenttargettype/direct-callexpression-as-for-in-lhs.js b/test/language/expressions/assignmenttargettype/direct-callexpression-as-for-in-lhs.js new file mode 100644 index 0000000000..b4913aef5d --- /dev/null +++ b/test/language/expressions/assignmenttargettype/direct-callexpression-as-for-in-lhs.js @@ -0,0 +1,24 @@ +// This file was procedurally generated from the following sources: +// - src/assignment-target-type/callexpression-as-for-in-lhs.case +// - src/assignment-target-type/invalid/statement/default.template +/*--- +description: Static Semantics AssignmentTargetType, Return web-compat. (Direct assignment) +flags: [generated, onlyStrict] +negative: + phase: parse + type: SyntaxError +info: | + Direct assignment + + CallExpression : + CoverCallExpressionAndAsyncArrowHead + CallExpression Arguments + 1. If the host is a web browser or otherwise supports Runtime Errors for Function Call Assignment Targets, then + a. If IsStrict(this CallExpression) is false, return ~web-compat~. + 2. Return ~invalid~. + +---*/ + +$DONOTEVALUATE(); + +for (f() in [1]) {} diff --git a/test/language/expressions/assignmenttargettype/direct-callexpression-as-for-of-lhs.js b/test/language/expressions/assignmenttargettype/direct-callexpression-as-for-of-lhs.js new file mode 100644 index 0000000000..6352d13715 --- /dev/null +++ b/test/language/expressions/assignmenttargettype/direct-callexpression-as-for-of-lhs.js @@ -0,0 +1,24 @@ +// This file was procedurally generated from the following sources: +// - src/assignment-target-type/callexpression-as-for-of-lhs.case +// - src/assignment-target-type/invalid/statement/default.template +/*--- +description: Static Semantics AssignmentTargetType, Return web-compat. (Direct assignment) +flags: [generated, onlyStrict] +negative: + phase: parse + type: SyntaxError +info: | + Direct assignment + + CallExpression : + CoverCallExpressionAndAsyncArrowHead + CallExpression Arguments + 1. If the host is a web browser or otherwise supports Runtime Errors for Function Call Assignment Targets, then + a. If IsStrict(this CallExpression) is false, return ~web-compat~. + 2. Return ~invalid~. + +---*/ + +$DONOTEVALUATE(); + +for (f() of [1]) {} diff --git a/test/language/expressions/assignmenttargettype/direct-callexpression-in-compound-assignment.js b/test/language/expressions/assignmenttargettype/direct-callexpression-in-compound-assignment.js new file mode 100644 index 0000000000..013e725d4f --- /dev/null +++ b/test/language/expressions/assignmenttargettype/direct-callexpression-in-compound-assignment.js @@ -0,0 +1,24 @@ +// This file was procedurally generated from the following sources: +// - src/assignment-target-type/callexpression-in-compound-assignment.case +// - src/assignment-target-type/invalid/direct.template +/*--- +description: Static Semantics AssignmentTargetType, Return web-compat. (Direct assignment) +flags: [generated, onlyStrict] +negative: + phase: parse + type: SyntaxError +info: | + Direct assignment + + CallExpression : + CoverCallExpressionAndAsyncArrowHead + CallExpression Arguments + 1. If the host is a web browser or otherwise supports Runtime Errors for Function Call Assignment Targets, then + a. If IsStrict(this CallExpression) is false, return ~web-compat~. + 2. Return ~invalid~. + +---*/ + +$DONOTEVALUATE(); + +f() += 1; diff --git a/test/language/expressions/assignmenttargettype/direct-callexpression-in-logical-assignment.js b/test/language/expressions/assignmenttargettype/direct-callexpression-in-logical-assignment.js new file mode 100644 index 0000000000..e4a7563ae7 --- /dev/null +++ b/test/language/expressions/assignmenttargettype/direct-callexpression-in-logical-assignment.js @@ -0,0 +1,24 @@ +// This file was procedurally generated from the following sources: +// - src/assignment-target-type/callexpression-in-logical-assignment.case +// - src/assignment-target-type/invalid/direct.template +/*--- +description: Static Semantics AssignmentTargetType, Return web-compat. (Direct assignment) +flags: [generated] +negative: + phase: parse + type: SyntaxError +info: | + Direct assignment + + CallExpression : + CoverCallExpressionAndAsyncArrowHead + CallExpression Arguments + 1. If the host is a web browser or otherwise supports Runtime Errors for Function Call Assignment Targets, then + a. If IsStrict(this CallExpression) is false, return ~web-compat~. + 2. Return ~invalid~. + +---*/ + +$DONOTEVALUATE(); + +f() &&= 1; diff --git a/test/language/expressions/assignmenttargettype/direct-callexpression-in-postfix-update.js b/test/language/expressions/assignmenttargettype/direct-callexpression-in-postfix-update.js new file mode 100644 index 0000000000..d4e5a52750 --- /dev/null +++ b/test/language/expressions/assignmenttargettype/direct-callexpression-in-postfix-update.js @@ -0,0 +1,24 @@ +// This file was procedurally generated from the following sources: +// - src/assignment-target-type/callexpression-in-postfix-update.case +// - src/assignment-target-type/invalid/statement/default.template +/*--- +description: Static Semantics AssignmentTargetType, Return web-compat. (Direct assignment) +flags: [generated, onlyStrict] +negative: + phase: parse + type: SyntaxError +info: | + Direct assignment + + CallExpression : + CoverCallExpressionAndAsyncArrowHead + CallExpression Arguments + 1. If the host is a web browser or otherwise supports Runtime Errors for Function Call Assignment Targets, then + a. If IsStrict(this CallExpression) is false, return ~web-compat~. + 2. Return ~invalid~. + +---*/ + +$DONOTEVALUATE(); + +f()++; diff --git a/test/language/expressions/assignmenttargettype/direct-callexpression-in-prefix-update.js b/test/language/expressions/assignmenttargettype/direct-callexpression-in-prefix-update.js new file mode 100644 index 0000000000..93ff1671f2 --- /dev/null +++ b/test/language/expressions/assignmenttargettype/direct-callexpression-in-prefix-update.js @@ -0,0 +1,24 @@ +// This file was procedurally generated from the following sources: +// - src/assignment-target-type/callexpression-in-prefix-update.case +// - src/assignment-target-type/invalid/statement/default.template +/*--- +description: Static Semantics AssignmentTargetType, Return web-compat. (Direct assignment) +flags: [generated, onlyStrict] +negative: + phase: parse + type: SyntaxError +info: | + Direct assignment + + CallExpression : + CoverCallExpressionAndAsyncArrowHead + CallExpression Arguments + 1. If the host is a web browser or otherwise supports Runtime Errors for Function Call Assignment Targets, then + a. If IsStrict(this CallExpression) is false, return ~web-compat~. + 2. Return ~invalid~. + +---*/ + +$DONOTEVALUATE(); + +++f(); diff --git a/test/language/expressions/assignmenttargettype/direct-callexpression.js b/test/language/expressions/assignmenttargettype/direct-callexpression.js new file mode 100644 index 0000000000..28475f377e --- /dev/null +++ b/test/language/expressions/assignmenttargettype/direct-callexpression.js @@ -0,0 +1,24 @@ +// This file was procedurally generated from the following sources: +// - src/assignment-target-type/callexpression.case +// - src/assignment-target-type/invalid/direct.template +/*--- +description: Static Semantics AssignmentTargetType, Return web-compat. (Direct assignment) +flags: [generated, onlyStrict] +negative: + phase: parse + type: SyntaxError +info: | + Direct assignment + + CallExpression : + CoverCallExpressionAndAsyncArrowHead + CallExpression Arguments + 1. If the host is a web browser or otherwise supports Runtime Errors for Function Call Assignment Targets, then + a. If IsStrict(this CallExpression) is false, return ~web-compat~. + 2. Return ~invalid~. + +---*/ + +$DONOTEVALUATE(); + +f() = 1; diff --git a/test/language/expressions/assignmenttargettype/parenthesized-callexpression-arguments.js b/test/language/expressions/assignmenttargettype/parenthesized-callexpression-arguments.js deleted file mode 100644 index 31f6e6e405..0000000000 --- a/test/language/expressions/assignmenttargettype/parenthesized-callexpression-arguments.js +++ /dev/null @@ -1,23 +0,0 @@ -// This file was procedurally generated from the following sources: -// - src/assignment-target-type/callexpression-arguments.case -// - src/assignment-target-type/invalid/parenthesized.template -/*--- -description: Static Semantics AssignmentTargetType, Return invalid. (ParenthesizedExpression) -esid: sec-grouping-operator-static-semantics-assignmenttargettype -flags: [generated] -negative: - phase: parse - type: SyntaxError -info: | - ParenthesizedExpression: (Expression) - - Return AssignmentTargetType of Expression. - - CallExpression Arguments - Static Semantics AssignmentTargetType, Return invalid. - ----*/ - -$DONOTEVALUATE(); - -(f()) = 1; diff --git a/test/language/expressions/assignmenttargettype/parenthesized-callexpression-in-compound-assignment.js b/test/language/expressions/assignmenttargettype/parenthesized-callexpression-in-compound-assignment.js new file mode 100644 index 0000000000..61838d1f65 --- /dev/null +++ b/test/language/expressions/assignmenttargettype/parenthesized-callexpression-in-compound-assignment.js @@ -0,0 +1,27 @@ +// This file was procedurally generated from the following sources: +// - src/assignment-target-type/callexpression-in-compound-assignment.case +// - src/assignment-target-type/invalid/parenthesized.template +/*--- +description: Static Semantics AssignmentTargetType, Return web-compat. (ParenthesizedExpression) +esid: sec-grouping-operator-static-semantics-assignmenttargettype +flags: [generated, onlyStrict] +negative: + phase: parse + type: SyntaxError +info: | + ParenthesizedExpression: (Expression) + + Return AssignmentTargetType of Expression. + + CallExpression : + CoverCallExpressionAndAsyncArrowHead + CallExpression Arguments + 1. If the host is a web browser or otherwise supports Runtime Errors for Function Call Assignment Targets, then + a. If IsStrict(this CallExpression) is false, return ~web-compat~. + 2. Return ~invalid~. + +---*/ + +$DONOTEVALUATE(); + +(f()) += 1; diff --git a/test/language/expressions/assignmenttargettype/parenthesized-callexpression-in-logical-assignment.js b/test/language/expressions/assignmenttargettype/parenthesized-callexpression-in-logical-assignment.js new file mode 100644 index 0000000000..eef6b09620 --- /dev/null +++ b/test/language/expressions/assignmenttargettype/parenthesized-callexpression-in-logical-assignment.js @@ -0,0 +1,27 @@ +// This file was procedurally generated from the following sources: +// - src/assignment-target-type/callexpression-in-logical-assignment.case +// - src/assignment-target-type/invalid/parenthesized.template +/*--- +description: Static Semantics AssignmentTargetType, Return web-compat. (ParenthesizedExpression) +esid: sec-grouping-operator-static-semantics-assignmenttargettype +flags: [generated] +negative: + phase: parse + type: SyntaxError +info: | + ParenthesizedExpression: (Expression) + + Return AssignmentTargetType of Expression. + + CallExpression : + CoverCallExpressionAndAsyncArrowHead + CallExpression Arguments + 1. If the host is a web browser or otherwise supports Runtime Errors for Function Call Assignment Targets, then + a. If IsStrict(this CallExpression) is false, return ~web-compat~. + 2. Return ~invalid~. + +---*/ + +$DONOTEVALUATE(); + +(f()) &&= 1; diff --git a/test/language/expressions/assignmenttargettype/parenthesized-callexpression.js b/test/language/expressions/assignmenttargettype/parenthesized-callexpression.js new file mode 100644 index 0000000000..45e3eb6c17 --- /dev/null +++ b/test/language/expressions/assignmenttargettype/parenthesized-callexpression.js @@ -0,0 +1,27 @@ +// This file was procedurally generated from the following sources: +// - src/assignment-target-type/callexpression.case +// - src/assignment-target-type/invalid/parenthesized.template +/*--- +description: Static Semantics AssignmentTargetType, Return web-compat. (ParenthesizedExpression) +esid: sec-grouping-operator-static-semantics-assignmenttargettype +flags: [generated, onlyStrict] +negative: + phase: parse + type: SyntaxError +info: | + ParenthesizedExpression: (Expression) + + Return AssignmentTargetType of Expression. + + CallExpression : + CoverCallExpressionAndAsyncArrowHead + CallExpression Arguments + 1. If the host is a web browser or otherwise supports Runtime Errors for Function Call Assignment Targets, then + a. If IsStrict(this CallExpression) is false, return ~web-compat~. + 2. Return ~invalid~. + +---*/ + +$DONOTEVALUATE(); + +(f()) = 1;