mirror of
https://github.com/vercel-labs/scriptc.git
synced 2026-10-02 08:35:07 +08:00
* Expand static Effect support across common APIs * Preserve compiler parity across expanded Effect patterns * Fix compiler regressions exposed by Effect coverage * Bound shared type conversion traversal * Clarify conversion contracts and tidy fixtures * Run every Effect fixture in CI shards * Preserve inferred array assignments in concurrent Effect programs * Record inferred array fixture compiler ordering
17 lines
720 B
JavaScript
17 lines
720 B
JavaScript
const apply = Function.prototype.apply;
|
|
function method(a, b) { return this.prefix + a + b; }
|
|
function read(fn) { return fn.apply; }
|
|
console.log(read(method) === apply);
|
|
console.log(apply.call(method, { prefix: "sum:" }, [2, 3]));
|
|
console.log(apply.call(method, { prefix: "object:" }, { 0: 2, 1: 3, length: 2 }));
|
|
console.log(method.apply({ prefix: "direct:" }, { 0: 2, 1: 3, length: 2 }));
|
|
const key = Symbol("apply");
|
|
method[key] = apply;
|
|
console.log(method[key]({ prefix: "next:" }, [4, 5]));
|
|
function remove(fn, symbol) { delete fn[symbol]; }
|
|
remove(method, key);
|
|
const assign = Object.assign;
|
|
const target = { a: 1 };
|
|
console.log(assign(target, { b: 2 }, { a: 3 }) === target);
|
|
console.log(JSON.stringify(target));
|