diff --git a/test/language/expressions/logical-assignment/lgcl-and-assignment-operator-namedevaluation-arrow-function.js b/test/language/expressions/logical-assignment/lgcl-and-assignment-operator-namedevaluation-arrow-function.js new file mode 100644 index 0000000000..283c3a50d9 --- /dev/null +++ b/test/language/expressions/logical-assignment/lgcl-and-assignment-operator-namedevaluation-arrow-function.js @@ -0,0 +1,20 @@ +// Copyright (c) 2020 Ecma International. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-assignment-operators-runtime-semantics-evaluation +description: NamedEvaluation of Logical And Assignment +info: | + AssignmentExpression: + LeftHandSideExpression &&= AssignmentExpression + + 5. If IsAnonymousFunctionDefinition(AssignmentExpression) and IsIdentifierRef of LeftHandSideExpression are both true, then + a. Let rval be NamedEvaluation of AssignmentExpression with argument GetReferencedName(lref). +features: [logical-assignment-operators] + +---*/ + +var value = 1; +value &&= () => {}; + +assert.sameValue(value.name, "value", "value"); diff --git a/test/language/expressions/logical-assignment/lgcl-and-assignment-operator-namedevaluation-class-expression.js b/test/language/expressions/logical-assignment/lgcl-and-assignment-operator-namedevaluation-class-expression.js new file mode 100644 index 0000000000..af96ddaaa9 --- /dev/null +++ b/test/language/expressions/logical-assignment/lgcl-and-assignment-operator-namedevaluation-class-expression.js @@ -0,0 +1,20 @@ +// Copyright (c) 2020 Ecma International. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-assignment-operators-runtime-semantics-evaluation +description: NamedEvaluation of Logical And Assignment +info: | + AssignmentExpression: + LeftHandSideExpression &&= AssignmentExpression + + 5. If IsAnonymousFunctionDefinition(AssignmentExpression) and IsIdentifierRef of LeftHandSideExpression are both true, then + a. Let rval be NamedEvaluation of AssignmentExpression with argument GetReferencedName(lref). +features: [logical-assignment-operators] + +---*/ + +var value = 1; +value &&= class {}; + +assert.sameValue(value.name, "value", "value"); diff --git a/test/language/expressions/logical-assignment/lgcl-and-assignment-operator-namedevaluation-function.js b/test/language/expressions/logical-assignment/lgcl-and-assignment-operator-namedevaluation-function.js new file mode 100644 index 0000000000..06948e3eef --- /dev/null +++ b/test/language/expressions/logical-assignment/lgcl-and-assignment-operator-namedevaluation-function.js @@ -0,0 +1,20 @@ +// Copyright (c) 2020 Ecma International. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-assignment-operators-runtime-semantics-evaluation +description: NamedEvaluation of Logical And Assignment +info: | + AssignmentExpression: + LeftHandSideExpression &&= AssignmentExpression + + 5. If IsAnonymousFunctionDefinition(AssignmentExpression) and IsIdentifierRef of LeftHandSideExpression are both true, then + a. Let rval be NamedEvaluation of AssignmentExpression with argument GetReferencedName(lref). +features: [logical-assignment-operators] + +---*/ + +var value = 1; +value &&= function() {}; + +assert.sameValue(value.name, "value", "value"); diff --git a/test/language/expressions/logical-assignment/lgcl-nullish-assignment-operator-namedevaluation-arrow-function.js b/test/language/expressions/logical-assignment/lgcl-nullish-assignment-operator-namedevaluation-arrow-function.js new file mode 100644 index 0000000000..9b9ec4cf15 --- /dev/null +++ b/test/language/expressions/logical-assignment/lgcl-nullish-assignment-operator-namedevaluation-arrow-function.js @@ -0,0 +1,20 @@ +// Copyright (c) 2020 Ecma International. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-assignment-operators-runtime-semantics-evaluation +description: NamedEvaluation of Logical Nullish Assignment +info: | + AssignmentExpression: + LeftHandSideExpression ??= AssignmentExpression + + 4. If IsAnonymousFunctionDefinition(AssignmentExpression) and IsIdentifierRef of LeftHandSideExpression are both true, then + a. Let rval be NamedEvaluation of AssignmentExpression with argument GetReferencedName(lref). +features: [logical-assignment-operators] + +---*/ + +var value = 1; +value ??= () => {}; + +assert.sameValue(value.name, "value", "value"); diff --git a/test/language/expressions/logical-assignment/lgcl-nullish-assignment-operator-namedevaluation-class-expression.js b/test/language/expressions/logical-assignment/lgcl-nullish-assignment-operator-namedevaluation-class-expression.js new file mode 100644 index 0000000000..f72090a5c3 --- /dev/null +++ b/test/language/expressions/logical-assignment/lgcl-nullish-assignment-operator-namedevaluation-class-expression.js @@ -0,0 +1,20 @@ +// Copyright (c) 2020 Ecma International. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-assignment-operators-runtime-semantics-evaluation +description: NamedEvaluation of Logical Nullish Assignment +info: | + AssignmentExpression: + LeftHandSideExpression ??= AssignmentExpression + + 4. If IsAnonymousFunctionDefinition(AssignmentExpression) and IsIdentifierRef of LeftHandSideExpression are both true, then + a. Let rval be NamedEvaluation of AssignmentExpression with argument GetReferencedName(lref). +features: [logical-assignment-operators] + +---*/ + +var value = 1; +value ??= class {}; + +assert.sameValue(value.name, "value", "value"); diff --git a/test/language/expressions/logical-assignment/lgcl-nullish-assignment-operator-namedevaluation-function.js b/test/language/expressions/logical-assignment/lgcl-nullish-assignment-operator-namedevaluation-function.js new file mode 100644 index 0000000000..456ae35848 --- /dev/null +++ b/test/language/expressions/logical-assignment/lgcl-nullish-assignment-operator-namedevaluation-function.js @@ -0,0 +1,20 @@ +// Copyright (c) 2020 Ecma International. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-assignment-operators-runtime-semantics-evaluation +description: NamedEvaluation of Logical Nullish Assignment +info: | + AssignmentExpression: + LeftHandSideExpression ??= AssignmentExpression + + 4. If IsAnonymousFunctionDefinition(AssignmentExpression) and IsIdentifierRef of LeftHandSideExpression are both true, then + a. Let rval be NamedEvaluation of AssignmentExpression with argument GetReferencedName(lref). +features: [logical-assignment-operators] + +---*/ + +var value = 1; +value ??= function() {}; + +assert.sameValue(value.name, "value", "value"); diff --git a/test/language/expressions/logical-assignment/lgcl-or-assignment-operator-namedevaluation-arrow-function.js b/test/language/expressions/logical-assignment/lgcl-or-assignment-operator-namedevaluation-arrow-function.js new file mode 100644 index 0000000000..fcef139702 --- /dev/null +++ b/test/language/expressions/logical-assignment/lgcl-or-assignment-operator-namedevaluation-arrow-function.js @@ -0,0 +1,20 @@ +// Copyright (c) 2020 Ecma International. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-assignment-operators-runtime-semantics-evaluation +description: NamedEvaluation of Logical Or Assignment +info: | + AssignmentExpression: + LeftHandSideExpression ||= AssignmentExpression + + 5. If IsAnonymousFunctionDefinition(AssignmentExpression) and IsIdentifierRef of LeftHandSideExpression are both true, then + a. Let rval be NamedEvaluation of AssignmentExpression with argument GetReferencedName(lref). +features: [logical-assignment-operators] + +---*/ + +var value = 1; +value ||= () => {}; + +assert.sameValue(value.name, "value", "value"); diff --git a/test/language/expressions/logical-assignment/lgcl-or-assignment-operator-namedevaluation-class-expression.js b/test/language/expressions/logical-assignment/lgcl-or-assignment-operator-namedevaluation-class-expression.js new file mode 100644 index 0000000000..aad32cf295 --- /dev/null +++ b/test/language/expressions/logical-assignment/lgcl-or-assignment-operator-namedevaluation-class-expression.js @@ -0,0 +1,20 @@ +// Copyright (c) 2020 Ecma International. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-assignment-operators-runtime-semantics-evaluation +description: NamedEvaluation of Logical Or Assignment +info: | + AssignmentExpression: + LeftHandSideExpression ||= AssignmentExpression + + 5. If IsAnonymousFunctionDefinition(AssignmentExpression) and IsIdentifierRef of LeftHandSideExpression are both true, then + a. Let rval be NamedEvaluation of AssignmentExpression with argument GetReferencedName(lref). +features: [logical-assignment-operators] + +---*/ + +var value = 1; +value ||= class {}; + +assert.sameValue(value.name, "value", "value"); diff --git a/test/language/expressions/logical-assignment/lgcl-or-assignment-operator-namedevaluation-function.js b/test/language/expressions/logical-assignment/lgcl-or-assignment-operator-namedevaluation-function.js new file mode 100644 index 0000000000..ce20ac458e --- /dev/null +++ b/test/language/expressions/logical-assignment/lgcl-or-assignment-operator-namedevaluation-function.js @@ -0,0 +1,20 @@ +// Copyright (c) 2020 Ecma International. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-assignment-operators-runtime-semantics-evaluation +description: NamedEvaluation of Logical Or Assignment +info: | + AssignmentExpression: + LeftHandSideExpression ||= AssignmentExpression + + 5. If IsAnonymousFunctionDefinition(AssignmentExpression) and IsIdentifierRef of LeftHandSideExpression are both true, then + a. Let rval be NamedEvaluation of AssignmentExpression with argument GetReferencedName(lref). +features: [logical-assignment-operators] + +---*/ + +var value = 1; +value ||= function() {}; + +assert.sameValue(value.name, "value", "value");