lib/coffee_script/narwhal/coffee-script.coffee in coffee-script-0.1.5 vs lib/coffee_script/narwhal/coffee-script.coffee in coffee-script-0.1.6
- old
+ new
@@ -19,11 +19,13 @@
# Run a simple REPL, round-tripping to the CoffeeScript compiler for every
# command.
exports.run: args =>
args.shift()
- return require(File.absolute(args[0])) if args.length
+ if args.length
+ exports.evalCS(File.read(path)) for path in args.
+ return true.
while true
try
system.stdout.write('coffee> ').flush()
result: exports.evalCS(Readline.readline())
@@ -49,10 +51,10 @@
eval(exports.compile(source)).
# Make a factory for the CoffeeScript environment.
exports.makeNarwhalFactory: path =>
code: exports.compileFile(path)
- factoryText: "function(require,exports,module,system,print){" + code + "/**/\n}"
+ factoryText: "function(require,exports,module,system,print){ 1 + 1 /**/\n}"
if system.engine is "rhino"
Packages.org.mozilla.javascript.Context.getCurrentContext().compileFunction(global, factoryText, path, 0, null)
else
# eval requires parenthesis, but parenthesis break compileFunction.
eval("(" + factoryText + ")")..