Skip to content

Commit

Permalink
Update test for o[p] = f()
Browse files Browse the repository at this point in the history
Update S11.13.1_A7_T3.js now that consensus has been reached on tc39/ecma262#3307.
  • Loading branch information
rkirsling committed Apr 11, 2024
1 parent d865ffe commit 6cfdc36
Showing 1 changed file with 17 additions and 4 deletions.
21 changes: 17 additions & 4 deletions test/language/expressions/assignment/S11.13.1_A7_T3.js
Original file line number Diff line number Diff line change
@@ -1,25 +1,38 @@
// 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.

/*---
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.
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 DummyError();
throw new Test262Error("property key evaluated");
}
};
var expr = function() {
throw new Test262Error("right-hand side expression evaluated");
throw new DummyError();
};

base[prop] = expr();
Expand Down

0 comments on commit 6cfdc36

Please sign in to comment.