mirror of
https://github.com/jashkenas/coffeescript.git
synced 2026-04-11 03:00:13 -04:00
CoffeeScript 0.2.6 is on the books
This commit is contained in:
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user