diff options
author | Jo-Philipp Wich <jo@mein.io> | 2020-11-09 15:53:40 +0100 |
---|---|---|
committer | Jo-Philipp Wich <jo@mein.io> | 2020-11-09 15:57:12 +0100 |
commit | 41385a0381a89516fd99989aa3a7dd84c6c33d64 (patch) | |
tree | 55b3e4721b633de0a495163956fef1b0cce722e1 /tests | |
parent | f6869ee3b02a60b202c703f7caef165ee3845e5a (diff) |
syntax: properly handle list expressions in function calls
Ensure that a call like `fn((1, 2), 3)` invokes the function with arguments
`2, 3` and not `1, 2, 3`.
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
Diffstat (limited to 'tests')
-rw-r--r-- | tests/00_syntax/20_list_expressions | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/tests/00_syntax/20_list_expressions b/tests/00_syntax/20_list_expressions index ef1b0c4..d5ba459 100644 --- a/tests/00_syntax/20_list_expressions +++ b/tests/00_syntax/20_list_expressions @@ -13,6 +13,7 @@ function call true true true +[ 2, 3 ] -- End -- -- Testcase -- @@ -37,5 +38,8 @@ true // computed property access uses the last list expression value print(({foo: true})["bar", "baz", "foo"], "\n"); + + // same list semantics apply to function call parameters + ((...args) => print(args, "\n"))((1, 2), 3); %} -- End -- |