summaryrefslogtreecommitdiffstats
path: root/js/src/tests/test262/language/expressions/assignment
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-06-12 05:43:14 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-06-12 05:43:14 +0000
commit8dd16259287f58f9273002717ec4d27e97127719 (patch)
tree3863e62a53829a84037444beab3abd4ed9dfc7d0 /js/src/tests/test262/language/expressions/assignment
parentReleasing progress-linux version 126.0.1-1~progress7.99u1. (diff)
downloadfirefox-8dd16259287f58f9273002717ec4d27e97127719.tar.xz
firefox-8dd16259287f58f9273002717ec4d27e97127719.zip
Merging upstream version 127.0.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'js/src/tests/test262/language/expressions/assignment')
-rw-r--r--js/src/tests/test262/language/expressions/assignment/S11.13.1_A7_T3.js28
-rw-r--r--js/src/tests/test262/language/expressions/assignment/target-member-computed-reference.js42
-rw-r--r--js/src/tests/test262/language/expressions/assignment/target-super-computed-reference.js51
3 files changed, 93 insertions, 28 deletions
diff --git a/js/src/tests/test262/language/expressions/assignment/S11.13.1_A7_T3.js b/js/src/tests/test262/language/expressions/assignment/S11.13.1_A7_T3.js
deleted file mode 100644
index 8675448e23..0000000000
--- a/js/src/tests/test262/language/expressions/assignment/S11.13.1_A7_T3.js
+++ /dev/null
@@ -1,28 +0,0 @@
-// Copyright (C) 2015 André Bargull. All rights reserved.
-// This code is governed by the BSD license found in the LICENSE file.
-
-/*---
-info: Assignment Operator evaluates its operands from left to right.
-description: >
- The left-hand side expression is evaluated before the right-hand side.
- Left-hand side expression is MemberExpression: base[prop]. Evaluating
- ToPropertyKey(prop) throws an error.
----*/
-
-function DummyError() { }
-
-assert.throws(DummyError, function() {
- var base = {};
- var prop = {
- toString: function() {
- throw new DummyError();
- }
- };
- var expr = function() {
- throw new Test262Error("right-hand side expression evaluated");
- };
-
- base[prop] = expr();
-});
-
-reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/assignment/target-member-computed-reference.js b/js/src/tests/test262/language/expressions/assignment/target-member-computed-reference.js
new file mode 100644
index 0000000000..fefc73370f
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/assignment/target-member-computed-reference.js
@@ -0,0 +1,42 @@
+// Copyright (C) 2015 André Bargull. All rights reserved.
+// Copyright (C) 2024 Sony Interactive Entertainment Inc. All rights reserved.
+// This code is governed by the BSD license found in the LICENSE file.
+
+/*---
+esid: sec-assignment-operators
+description: Assignment Operator evaluates its operands from left to right (formerly S11.13.1_A7_T3)
+info: |
+ The left-hand side expression is evaluated before the right-hand side.
+ Left-hand side expression is MemberExpression: base[prop].
+ ToPropertyKey(prop) occurs after both sides are evaluated.
+---*/
+
+function DummyError() { }
+
+assert.throws(DummyError, function() {
+ var base = {};
+ var prop = function() {
+ throw new DummyError();
+ };
+ var expr = function() {
+ throw new Test262Error("right-hand side expression evaluated");
+ };
+
+ base[prop()] = expr();
+});
+
+assert.throws(DummyError, function() {
+ var base = {};
+ var prop = {
+ toString: function() {
+ throw new Test262Error("property key evaluated");
+ }
+ };
+ var expr = function() {
+ throw new DummyError();
+ };
+
+ base[prop] = expr();
+});
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/assignment/target-super-computed-reference.js b/js/src/tests/test262/language/expressions/assignment/target-super-computed-reference.js
new file mode 100644
index 0000000000..39d692a81b
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/assignment/target-super-computed-reference.js
@@ -0,0 +1,51 @@
+// Copyright (C) 2024 Sony Interactive Entertainment Inc. All rights reserved.
+// This code is governed by the BSD license found in the LICENSE file.
+
+/*---
+esid: sec-assignment-operators
+description: Assignment Operator evaluates its operands from left to right
+info: |
+ The left-hand side expression is evaluated before the right-hand side.
+ Left-hand side expression is MemberExpression: super[prop].
+ ToPropertyKey(prop) occurs after both sides are evaluated.
+---*/
+
+function DummyError() {}
+
+assert.throws(DummyError, function() {
+ var prop = function() {
+ throw new DummyError();
+ };
+ var expr = function() {
+ throw new Test262Error("right-hand side expression evaluated");
+ };
+
+ class C extends class {} {
+ m() {
+ super[prop()] = expr();
+ }
+ }
+
+ (new C()).m();
+});
+
+assert.throws(DummyError, function() {
+ var prop = {
+ toString: function() {
+ throw new Test262Error("property key evaluated");
+ }
+ };
+ var expr = function() {
+ throw new DummyError();
+ };
+
+ class C extends class {} {
+ m() {
+ super[prop] = expr();
+ }
+ }
+
+ (new C()).m();
+});
+
+reportCompare(0, 0);