constructor.js (489B)
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 can be "constructor" 7 ---*/ 8 class C { 9 ['constructor']() { 10 return 1; 11 } 12 } 13 assert( 14 C !== C.prototype.constructor, 15 "The result of `C !== C.prototype.constructor` is `true`" 16 ); 17 assert.sameValue(new C().constructor(), 1, "`new C().constructor()` returns `1`"); 18 19 reportCompare(0, 0);