mirror of
https://github.com/vercel-labs/scriptc.git
synced 2026-11-07 08:33:50 +08:00
Drop the computed Array.isArray refusal from the stdlib fence snapshot
`Array.isArray([1])` folds after evaluating its argument, so the stdlib fence battery no longer reports SC1090 for it. The snapshot drops that diagnostic and the statement notes that it lowers.
This commit is contained in:
@@ -12,7 +12,7 @@ const g = globalThis;
|
||||
const nan = NaN; // lowers now — a non-finite numeric literal like Infinity
|
||||
const s5 = String(5);
|
||||
const n5 = Number.NaN; // lowers now, with the other Number constants
|
||||
const isArr = Array.isArray([1]);
|
||||
const isArr = Array.isArray([1]); // lowers now: a computed argument folds after it is evaluated
|
||||
const merged = Object.assign({}, { a: 1 }); // the empty-target literal-source shape lowers now (it IS the source literal)
|
||||
const aliasedAssign = Object.assign(merged, { b: 2 }); // aliased targets stay fenced (real mutation of a live object)
|
||||
const refl = Reflect.has({ a: 1 }, "a");
|
||||
|
||||
@@ -1,10 +1,3 @@
|
||||
stdlib-fence.ts:15:15 - error SC1090: statically-decided Array.isArray on computed arguments (bind the value to a variable first) are not supported yet
|
||||
|
||||
14 | const n5 = Number.NaN; // lowers now, with the other Number constants
|
||||
15 | const isArr = Array.isArray([1]);
|
||||
| ^~~~~~~~~~~~~~~~~~
|
||||
16 | const merged = Object.assign({}, { a: 1 }); // the empty-target literal-source shape lowers now (it IS the source literal)
|
||||
|
||||
stdlib-fence.ts:17:23 - error SC2020: 'Object.assign' is part of the standard library types but has no scriptc lowering yet
|
||||
|
||||
16 | const merged = Object.assign({}, { a: 1 }); // the empty-target literal-source shape lowers now (it IS the source literal)
|
||||
|
||||
Reference in New Issue
Block a user