regular-subclassing.js (546B)
1 // Copyright (C) 2016 the V8 project authors. All rights reserved. 2 // This code is governed by the BSD license found in the LICENSE file. 3 /*--- 4 es6id: 19.1.1 5 description: Subclassing Object 6 info: | 7 19.1.1 The Object Constructor 8 9 The Object constructor is designed to be subclassable. It may be used as the 10 value of an extends clause of a class definition. 11 ---*/ 12 13 class Obj extends Object {} 14 15 var obj = new Obj(); 16 17 assert.notSameValue( 18 Object.getPrototypeOf(obj), Object.prototype, 19 'returns the class prototype' 20 ); 21 22 reportCompare(0, 0);