1
0
Fork 0
mirror of https://github.com/jashkenas/coffeescript.git synced 2022-11-09 12:23:24 -05:00

reverting tests from @geraldalewis's fix for #1216

This commit is contained in:
Michael Ficarra 2011-05-10 23:23:31 -04:00
parent 2212e959ac
commit a024ec5b27

View file

@ -268,38 +268,3 @@ test "existential assignment", ->
eq nonce, c
d ?= nonce
eq nonce, d
test "#1216 ?= compilation", ->
c = (s) -> CoffeeScript.compile( s, {bare:true} )
# ?= with locally scoped var defined
eq c('a = 0; a ?= b'),
'''var a;
a = 0;
if (a == null) {
a = b;
};'''
# ?= with locally scoped var not defined
eq c('a ?= b'),
'''if (typeof a === "undefined" || a === null) {
a = b;
};'''
# ? with locally scoped var defined
eq c('a = 0; return unless a?'),
'''
var a;
a = 0;
if (a == null) {
return;
}
'''
# ? with locally scoped var not defined
eq c('return unless a?'),
'''
if (typeof a === "undefined" || a === null) {
return;
}
'''