fixed the bin/cs repl to save assignment between commands by using the new --no-wrap

This commit is contained in:
Jeremy Ashkenas
2009-12-24 17:45:23 -08:00
parent 9b2326492b
commit 378e156e11

View File

@@ -32,7 +32,7 @@ exports.run = function(args) {
var coffeePath = FILE.path(module.path).dirname().dirname().join("bin", "coffee-script");
exports.compileFile = function(path) {
var coffee = OS.popen([coffeePath, "--print", path]);
var coffee = OS.popen([coffeePath, "--print", "--no-wrap", path]);
if (coffee.wait() !== 0)
throw new Error("coffee compiler error");
@@ -41,7 +41,7 @@ exports.compileFile = function(path) {
}
exports.compile = function(source) {
var coffee = OS.popen([coffeePath, "-e"]);
var coffee = OS.popen([coffeePath, "--eval", "--no-wrap"]);
coffee.stdin.write(source).flush().close();
@@ -58,10 +58,6 @@ exports.cs_eval = function(source) {
var code = exports.compile(source);
// strip the function wrapper, we add our own.
// TODO: this is very fragile
code = code.split("\n").slice(1,-2).join("\n");
return eval(code);
}
@@ -70,10 +66,6 @@ exports.make_narwhal_factory = function(path) {
var code = exports.compileFile(path);
// strip the function wrapper, we add our own.
// TODO: this is very fragile
code = code.split("\n").slice(1,-2).join("\n");
var factoryText = "function(require,exports,module,system,print){" + code + "/**/\n}";
if (system.engine === "rhino")