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:
parent
2212e959ac
commit
a024ec5b27
1 changed files with 0 additions and 35 deletions
|
@ -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;
|
||||
}
|
||||
'''
|
||||
|
|
Loading…
Reference in a new issue