diff options
author | 2021-09-22 02:16:31 -0700 | |
---|---|---|
committer | 2021-09-22 02:16:31 -0700 | |
commit | 8f460a9be3d954d6be555d1bcd382383d23d9280 (patch) | |
tree | 4a64f0164554c99af419564a4e4885d27d09deff /integration/snippets/array-args-with-default-values.js | |
parent | 204b07f46b6c8985c8928ec58b51d941903ad69b (diff) | |
download | bun-8f460a9be3d954d6be555d1bcd382383d23d9280.tar.gz bun-8f460a9be3d954d6be555d1bcd382383d23d9280.tar.zst bun-8f460a9be3d954d6be555d1bcd382383d23d9280.zip |
Fix parsing bug with arrays that have default values
Diffstat (limited to 'integration/snippets/array-args-with-default-values.js')
-rw-r--r-- | integration/snippets/array-args-with-default-values.js | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/integration/snippets/array-args-with-default-values.js b/integration/snippets/array-args-with-default-values.js new file mode 100644 index 000000000..f733a1bfa --- /dev/null +++ b/integration/snippets/array-args-with-default-values.js @@ -0,0 +1,28 @@ +var lines; +const data = () => + lines.map(([a = null, b = null, c = null, d = null]) => ({ + a, + b, + c, + d, + })); + +export function test() { + let ran = false; + lines = [ + [undefined, undefined, undefined, undefined], + [undefined, undefined, undefined, undefined], + [undefined, undefined, undefined, undefined], + [undefined, undefined, undefined, undefined], + ]; + + for (let foo of data()) { + console.assert(foo.a === null); + console.assert(foo.b === null); + console.assert(foo.c === null); + console.assert(foo.d === null); + ran = true; + } + console.assert(ran); + testDone(import.meta.url); +} |