From 4808d67cdb716eeb9187bb36827420c5073c5db3 Mon Sep 17 00:00:00 2001 From: dk00 Date: Sat, 24 Dec 2016 11:09:12 +0800 Subject: [PATCH] Add a test case for impliclit it with default --- test/function.ls | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/test/function.ls b/test/function.ls index 3c5ba336c..903a60db2 100644 --- a/test/function.ls +++ b/test/function.ls @@ -244,7 +244,7 @@ eq ''' }); ''', LiveScript.compile '-> @it', {+bare,-header} -# Object shorthand `{it}` is `it` +#899 Object shorthand `{it}` is `it` eq ''' (function(it){ return { @@ -253,6 +253,13 @@ eq ''' }); ''', LiveScript.compile '-> {it}', {+bare,-header} +eq '''(function(it){ + return { + it: it != null ? it : 'default' + }; +}); +''', LiveScript.compile '-> {it=\\default}', {+bare,-header} + # Simple functions require no parens when comma-listed. funs = [->, -> 1, -> it, -> this, null] eq 1, +funs.3.call funs.2 funs.1()