Debian Codegraph @

tests/auto/qml/ecmascripttests/test262/test/language/expressions/assignment/S11.13.1_A7_T3.js

raw
1 // Copyright (C) 2015 André Bargull. All rights reserved.
2 // This code is governed by the BSD license found in the LICENSE file.
3
4 /*---
5 info: Assignment Operator evaluates its operands from left to right.
6 description: >
7 The left-hand side expression is evaluated before the right-hand side.
8 Left-hand side expression is MemberExpression: base[prop]. Evaluating
9 ToPropertyKey(prop) throws an error.
10 ---*/
11
12 function DummyError() { }
13
14 assert.throws(DummyError, function() {
15 var base = {};
16 var prop = {
17 toString: function() {
18 throw new DummyError();
19 }
20 };
21 var expr = function() {
22 $ERROR("right-hand side expression evaluated");
23 };
24
25 base[prop] = expr();
26 });