Skip to content

Commit

Permalink
Add a test case for impliclit it with default
Browse files Browse the repository at this point in the history
  • Loading branch information
dk00 committed Dec 24, 2016
1 parent 3b9421a commit 4808d67
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion test/function.ls
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand All @@ -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()
Expand Down

0 comments on commit 4808d67

Please sign in to comment.