nesh icon indicating copy to clipboard operation
nesh copied to clipboard

Combining babel and eval leads to a syntax error in eval

Open blazzy opened this issue 8 years ago • 2 comments

Eval works as expected when I attempt a simple console.log nesh -e 'console.log("hello world");'.

But if I introduce the babel flag nesh -b -e 'console.log("hello world");', the eval blows up with the following error:

Error in plugin eval:
SyntaxError: Unexpected identifier
    at Object.exports.runInThisContext (vm.js:53:16)
    at exports.postStart (/usr/local/Cellar/nvm/0.26.1/versions/node/v4.0.0/lib/node_modules/nesh/lib/plugins/eval.js:24:19)
    at callPluginMethod (/usr/local/Cellar/nvm/0.26.1/versions/node/v4.0.0/lib/node_modules/nesh/lib/nesh.js:73:9)
    at process (/usr/local/Cellar/nvm/0.26.1/versions/node/v4.0.0/lib/node_modules/nesh/lib/nesh.js:40:16)
    at /usr/local/Cellar/nvm/0.26.1/versions/node/v4.0.0/lib/node_modules/nesh/lib/nesh.js:52:18
    at callPluginMethod (/usr/local/Cellar/nvm/0.26.1/versions/node/v4.0.0/lib/node_modules/nesh/lib/nesh.js:78:14)
    at process (/usr/local/Cellar/nvm/0.26.1/versions/node/v4.0.0/lib/node_modules/nesh/lib/nesh.js:40:16)
    at process (/usr/local/Cellar/nvm/0.26.1/versions/node/v4.0.0/lib/node_modules/nesh/lib/nesh.js:55:16)
    at processPlugins (/usr/local/Cellar/nvm/0.26.1/versions/node/v4.0.0/lib/node_modules/nesh/lib/nesh.js:58:12)
    at /usr/local/Cellar/nvm/0.26.1/versions/node/v4.0.0/lib/node_modules/nesh/lib/nesh.js:105:14

Here is the version info on launch with the babel flag Babel 5.8.25 on Node v4.0.0.

And the output of nesh --version is nesh version 1.6.0. The latest version as of this post.

blazzy avatar Oct 20 '15 18:10 blazzy

I'm having the same issue. Any update on this?

bjrnt avatar Oct 28 '15 06:10 bjrnt

Perhaps related to #44 that also fails to combine babel and eval?

holyjak avatar Nov 11 '16 10:11 holyjak