side-effects-in-property-define.js (437B)
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: 14.5 5 description: > 6 class side effects in property define 7 ---*/ 8 function B() {} 9 B.prototype = { 10 constructor: B, 11 set m(v) { 12 throw Error(); 13 } 14 }; 15 16 class C extends B { 17 m() { return 1; } 18 } 19 20 assert.sameValue(new C().m(), 1, "`new C().m()` returns `1`"); 21 22 reportCompare(0, 0);