From f041da4b10654dae5492d19bdd15e7123d02ecbf Mon Sep 17 00:00:00 2001 From: Chris Tate Date: Wed, 28 Oct 2026 08:56:20 -0500 Subject: [PATCH] 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. --- tests/diagnostics/stdlib-fence.ts | 2 +- tests/harness/__snapshots__/stdlib-fence.ts.txt | 7 ------- 2 files changed, 1 insertion(+), 8 deletions(-) diff --git a/tests/diagnostics/stdlib-fence.ts b/tests/diagnostics/stdlib-fence.ts index 0952436e1..b3eff41f5 100644 --- a/tests/diagnostics/stdlib-fence.ts +++ b/tests/diagnostics/stdlib-fence.ts @@ -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"); diff --git a/tests/harness/__snapshots__/stdlib-fence.ts.txt b/tests/harness/__snapshots__/stdlib-fence.ts.txt index 313a9391b..6ba862c53 100644 --- a/tests/harness/__snapshots__/stdlib-fence.ts.txt +++ b/tests/harness/__snapshots__/stdlib-fence.ts.txt @@ -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)