Files
scriptc/tests/corpus/native-object-for-in-minimal.js
Chris Tate f8906d0b75 Expand static native object and array semantics (#569)
* Support primitive and function property descriptors

* Dispatch literal bracket calls to native class methods

* Handle numeric class method keys in bracket calls

* Call function values returned by class accessors

* Expand native object and array semantics

* Keep new corpus fixtures aligned with compiler gates

* Lower Object.isFrozen arguments once
2026-09-29 08:30:54 -05:00

12 lines
417 B
JavaScript

const parent = JSON.parse('{"first":1,"second":2}');
const child = Object.create(parent);
console.log(Object.keys(parent).join(','));
console.log(Object.getOwnPropertyNames(parent).join(','));
console.log('first' in child);
const parentKeys = [];
for (const key in parent) parentKeys.push(key);
console.log(parentKeys.join(','));
const keys = [];
for (const key in child) keys.push(key);
console.log(keys.join(','));