diff options
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); +} |