Skip to content

Commit 4808d67

Browse files
committed
Add a test case for impliclit it with default
1 parent 3b9421a commit 4808d67

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

test/function.ls

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -244,7 +244,7 @@ eq '''
244244
});
245245
''', LiveScript.compile '-> @it', {+bare,-header}
246246

247-
# Object shorthand `{it}` is `it`
247+
#899 Object shorthand `{it}` is `it`
248248
eq '''
249249
(function(it){
250250
return {
@@ -253,6 +253,13 @@ eq '''
253253
});
254254
''', LiveScript.compile '-> {it}', {+bare,-header}
255255

256+
eq '''(function(it){
257+
return {
258+
it: it != null ? it : 'default'
259+
};
260+
});
261+
''', LiveScript.compile '-> {it=\\default}', {+bare,-header}
262+
256263
# Simple functions require no parens when comma-listed.
257264
funs = [->, -> 1, -> it, -> this, null]
258265
eq 1, +funs.3.call funs.2 funs.1()

0 commit comments

Comments
 (0)