property-description-must-be-an-object-not-bigint.js (568B)
1 // Copyright (C) 2020 Rick Waldron. All rights reserved. 2 // This code is governed by the BSD license found in the LICENSE file. 3 /*--- 4 esid: sec-object.defineproperty 5 description: > 6 Property description must be an object (bigint) 7 info: | 8 Object.defineProperty ( O, P, Attributes ) 9 10 ... 11 Let desc be ? ToPropertyDescriptor(Attributes). 12 ... 13 14 ToPropertyDescriptor ( Obj ) 15 16 If Type(Obj) is not Object, throw a TypeError exception. 17 ... 18 features: [BigInt] 19 ---*/ 20 21 assert.throws(TypeError, () => { 22 Object.defineProperty({}, 'a', 0n); 23 }); 24 25 reportCompare(0, 0);