Page Menu
Home
Phorge
Search
Configure Global Search
Log In
Files
F5379966
test_reflect_get_own_property_descriptor.cjs
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Flag For Later
Award Token
Size
967 B
Referenced Files
None
Subscribers
None
test_reflect_get_own_property_descriptor.cjs
View Options
function assert(condition, message) {
if (!condition) throw new Error(message);
}
const sym = Symbol('own');
const object = { value: 1, [sym]: 2 };
const symbolDesc = Reflect.getOwnPropertyDescriptor(object, sym);
assert(symbolDesc && symbolDesc.value === 2, 'Reflect.getOwnPropertyDescriptor should support symbol keys');
const arrayProtoDesc = Reflect.getOwnPropertyDescriptor(Array.prototype, 'push');
assert(arrayProtoDesc && typeof arrayProtoDesc.value === 'function', 'Reflect.getOwnPropertyDescriptor should support array prototype objects');
assert(typeof Array.prototype.push.apply === 'function', 'reflecting native array methods should preserve Function.prototype.apply fallback');
for (const key of Reflect.ownKeys(Atomics)) {
assert(
Reflect.getOwnPropertyDescriptor(Atomics, key) !== undefined,
'Reflect.getOwnPropertyDescriptor should describe each Reflect.ownKeys result'
);
}
console.log('reflect:get-own-property-descriptor:ok');
File Metadata
Details
Attached
Mime Type
application/javascript
Expires
Sun, May 17, 11:26 AM (1 d, 23 h)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
554714
Default Alt Text
test_reflect_get_own_property_descriptor.cjs (967 B)
Attached To
Mode
rANT Ant
Attached
Detach File
Event Timeline
Log In to Comment