CoffeeScript 0.2.6 is on the books

This commit is contained in:
Jeremy Ashkenas
2010-01-17 18:12:59 -05:00
parent 80fbe02fda
commit 63c9b5c2f0
17 changed files with 157 additions and 58 deletions

View File

@@ -20,28 +20,31 @@
// Run a simple REPL, round-tripping to the CoffeeScript compiler for every
// command.
exports.run = function run(args) {
var __a, i, path, result;
var __a, __b, i, path, result;
if (args.length) {
__a = args;
for (i=0; i<__a.length; i++) {
for (i = 0; i < __a.length; i++) {
path = __a[i];
exports.evalCS(File.read(path));
delete args[i];
}
return true;
}
__b = [];
while (true) {
try {
system.stdout.write('coffee> ').flush();
result = exports.evalCS(Readline.readline(), ['--globals']);
if (result !== undefined) {
print(result);
__b.push((function() {
try {
system.stdout.write('coffee> ').flush();
result = exports.evalCS(Readline.readline(), ['--globals']);
if (result !== undefined) {
return print(result);
}
} catch (e) {
return print(e);
}
} catch (e) {
print(e);
}
})());
}
return null;
return __b;
};
// Compile a given CoffeeScript file into JavaScript.
exports.compileFile = function compileFile(path) {