getter.js (360B)
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 Computed property names for getters 7 ---*/ 8 class C { 9 get ['a']() { 10 return 'A'; 11 } 12 } 13 assert.sameValue(new C().a, 'A', "The value of `new C().a` is `'A'`"); 14 15 reportCompare(0, 0);