jashkenas--coffeescript/test/test_compilation.coffee

20 lines
499 B
CoffeeScript
Raw Normal View History

# Ensure that carriage returns don't break compilation on Windows.
2010-10-09 20:07:39 +00:00
js = CoffeeScript.compile("one\r\ntwo", {wrap: off})
ok js is "one;\ntwo;"
2010-07-25 05:23:37 +00:00
global.resultArray = []
2010-10-09 20:07:39 +00:00
CoffeeScript.run("resultArray.push i for i of global", {wrap: off, globals: on, fileName: 'tests'})
ok 'setInterval' in global.resultArray
2010-10-09 20:07:39 +00:00
ok 'passed' is CoffeeScript.eval '"passed"', wrap: off, globals: on, fileName: 'tests'
#750
try
CoffeeScript.nodes 'f(->'
ok no
catch e
eq e.message, 'unclosed CALL_START on line 1'