message-method-prop.js (1220B)
1 // |reftest| shell-option(--enable-explicit-resource-management) skip-if(!(this.hasOwnProperty('getBuildConfiguration')&&getBuildConfiguration('explicit-resource-management'))||!xulRuntime.shell) -- explicit-resource-management is not enabled unconditionally, requires shell-options 2 // Copyright (C) 2023 Ron Buckton. All rights reserved. 3 // This code is governed by the BSD license found in the LICENSE file. 4 5 /*--- 6 esid: sec-suppressederror-constructor 7 description: > 8 Creates a method property for message 9 info: | 10 SuppressedError ( error, suppressed, message ) 11 12 ... 13 5. If message is not undefined, then 14 a. Let msg be ? ToString(message). 15 b. Perform ! CreateMethodProperty(O, "message", msg). 16 6. Return O. 17 18 CreateMethodProperty ( O, P, V ) 19 20 ... 21 3. Let newDesc be the PropertyDescriptor { [[Value]]: V, [[Writable]]: true, [[Enumerable]]: false, [[Configurable]]: true }. 22 4. Return ? O.[[DefineOwnProperty]](P, newDesc). 23 features: [explicit-resource-management] 24 includes: [propertyHelper.js] 25 ---*/ 26 27 var obj = new SuppressedError(undefined, undefined, '42'); 28 29 verifyProperty(obj, 'message', { 30 value: '42', 31 writable: true, 32 enumerable: false, 33 configurable: true, 34 }); 35 36 reportCompare(0, 0);