mirror of https://github.com/nodejs/node.git
parent
650a308634
commit
8971b59365
|
@ -75,7 +75,7 @@
|
|||
// Main entry point into most programs:
|
||||
process.nextTick(Module.runMain);
|
||||
|
||||
} else if (process._eval) {
|
||||
} else if (process._eval != null) {
|
||||
// User passed '-e' or '--eval' arguments to Node.
|
||||
var Module = NativeModule.require('module');
|
||||
var rv = new Module()._compile('return eval(process._eval)', 'eval');
|
||||
|
|
|
@ -47,3 +47,9 @@ child.exec(nodejs + ' --eval "require(\'./test/simple/test-cli-eval.js\')"',
|
|||
function(status, stdout, stderr) {
|
||||
assert.equal(status.code, 42);
|
||||
});
|
||||
|
||||
// empty program should do nothing
|
||||
child.exec(nodejs + ' -e ""', function(status, stdout, stderr) {
|
||||
assert.equal(stdout, 'undefined\n');
|
||||
assert.equal(stderr, '');
|
||||
});
|
||||
|
|
Loading…
Reference in New Issue