Skip to content
Permalink
Browse files

CLJS-984: Update Node.js REPL support to use public API

  • Loading branch information...
swannodette committed Jan 20, 2015
1 parent 1e5580c commit 62d898ae30eb58397628b45b3c0c95d3e899a274
Showing with 6 additions and 7 deletions.
  1. +2 −2 src/clj/cljs/repl/node_repl.js
  2. +4 −5 src/cljs/cljs/bootstrap_node.js
@@ -1,6 +1,7 @@
process.env.NODE_DISABLE_COLORS = true;

var net = require("net");
var vm = require("vm");
var PORT = 5001;

try {
@@ -27,8 +28,7 @@ net.createServer(function (socket) {
// not sure how \0's are getting through - David
data = data.replace(/\0/g, "");
try {
ret = process.binding('evals').NodeScript.runInThisContext.call(
global, data, "repl");
ret = vm.Script.runInThisContext.call(global, data, "repl");
} catch (e) {
err = e;
}
@@ -39,9 +39,9 @@
* @nocompile
*/


var fs = require('fs');
var path = require('path');
var fs = require("fs");
var vm = require("vm");
var path = require("path");
var CLJS_ROOT = "./";


@@ -76,8 +76,7 @@ global.CLOSURE_IMPORT_SCRIPT = function(src) {

// Declared here so it can be used to require base.js
function nodeGlobalRequire(file) {
process.binding('evals').NodeScript.runInThisContext.call(
global, fs.readFileSync(file), file);
vm.Script.runInThisContext.call(global, fs.readFileSync(file), file);

This comment has been minimized.

Copy link
@threepointone

threepointone Jan 20, 2015

just ran this; should be vm.runInThisContext, not vm.Script.runInThisContext (http://nodejs.org/api/vm.html)

I don't know why closure chooses the undefined latter.

}


0 comments on commit 62d898a

Please sign in to comment.
You can’t perform that action at this time.