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()