Debian Codegraph @

tests/auto/qml/ecmascripttests/test262/test/language/expressions/prefix-increment/S11.4.4_A6_T1.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: Operator ++x evaluates its reference expression once.
6 description: >
7 The operand expression is evaluated exactly once. Operand expression is
8 MemberExpression: base[prop]. base is the null value.
9 ---*/
10
11 function DummyError() { }
12
13 assert.throws(DummyError, function() {
14 var base = null;
15 var prop = function() {
16 throw new DummyError();
17 };
18
19 ++base[prop()];
20 });
21
22 assert.throws(TypeError, function() {
23 var base = null;
24 var prop = {
25 toString: function() {
26 $ERROR("property key evaluated");
27 }
28 };
29
30 ++base[prop];
31 });