mirror of
https://github.com/vercel-labs/scriptc.git
synced 2026-10-02 08:35:07 +08:00
* 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
12 lines
417 B
JavaScript
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(','));
|