danielgtaylor / danielgtaylor/nesh

Combining babel and eval leads to a syntax error in eval

Open
#41 2 comments 0 reactions 0 assignees View on GitHub
Dominant language
CoffeeScript
Stars
284
Forks
23
PR merge metrics
No merged PRs in 30d

Description

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.

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.