fix(javascript): account for active nullish pattern defaults

This commit is contained in:
hhang authored and Ysopwnable committed 2026-11-22 13:38:40 +08:00
1 parent 8ae636b6ab
commit c1943f196c
4 files changed
+18 -3

No files matched your search

@@ -29,6 +29,8 @@ it.each([
["void 0", "{}"],
["null", "[]"],
["null", "{} = {}"],
["undefined", "{} = null"],
["void 0", "[] = undefined"],
] as const)(
"leaves bindings after %s matched against %s unproven",
(value, pattern) => {
@@ -53,6 +55,7 @@ it.each([
["const model = { bad: {}, mode: 'one' };", "{}"],
["const model = { bad: [], mode: 'one' };", "[]"],
["const model = { bad: undefined, mode: 'one' };", "{} = {}"],
["const model = { bad: 0, mode: 'one' };", "{} = null"],
["const undefined = 0; const model = { bad: undefined, mode: 'one' };", "{}"],
] as const)(
"preserves the reachable sibling for %s against %s",