Debian Codegraph @

tests/auto/qml/ecmascripttests/test262/test/language/computed-property-names/object/accessor/setter.js

raw
1 // Copyright (C) 2014 the V8 project authors. All rights reserved.
2 // This code is governed by the BSD license found in the LICENSE file.
3 /*---
4 es6id: 12.2.5
5 description: >
6 In an object, duplicate computed property getter names produce only a single property of
7 that name, whose value is the value of the last property of that name.
8 ---*/
9 var calls = 0;
10 var A = {
11 set ['a'](_) {
12 calls++;
13 }
14 };
15 A.a = 'A';
16 assert.sameValue(calls, 1, "The value of `calls` is `1`, after executing `A.a = 'A';`");