mirror of
https://github.com/vercel-labs/scriptc.git
synced 2026-10-23 06:10:02 +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
14 lines
579 B
JavaScript
14 lines
579 B
JavaScript
const record = { 0: 2, 1: 4, 2: 6, length: 3 };
|
|
console.log(Array.prototype.findLast.call(record, value => value < 6));
|
|
console.log(Array.prototype.findLastIndex.call(record, value => value < 6));
|
|
console.log(Array.prototype.findLast.call(record, value => value > 9));
|
|
console.log(Array.prototype.findLastIndex.call(record, value => value > 9));
|
|
|
|
const sparse = { 0: 1, 2: 3, length: 3 };
|
|
const seen = [];
|
|
console.log(Array.prototype.findLastIndex.call(sparse, (value, index) => {
|
|
seen.push(`${index}:${value}`);
|
|
return value === undefined;
|
|
}));
|
|
console.log(seen.join(','));
|