Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

node --eval "require('./')" #46

Closed
Mithgol opened this issue Mar 13, 2014 · 4 comments · Fixed by #50
Closed

node --eval "require('./')" #46

Mithgol opened this issue Mar 13, 2014 · 4 comments · Fixed by #50

Comments

@Mithgol
Copy link
Contributor

Mithgol commented Mar 13, 2014

Test the node --eval "require('./')" problem for #39.

@Mithgol Mithgol mentioned this issue Mar 13, 2014
2 tasks
@Mithgol
Copy link
Contributor Author

Mithgol commented Mar 13, 2014

Node.js v0.10.26 on Windows 7 Professional Service Pack 1:

(screenshot)

It seems that a failure in require(…) (when the given module does not exist) is caught successfully.

A couple of other tests are necessary for the node --eval "require('./')" solution:

  • an existing (but erroneous) module — REPL is probably not suitable for testing if REPL is too greedy in trying to catch syntax errors
  • what happens on non-Windows systems (especially on Travis)

@Mithgol
Copy link
Contributor Author

Mithgol commented Mar 13, 2014

First test passed. REPL does not seem to interfere.

@springmeyer
Copy link
Contributor

maybe using vm to try to require directly would be more consistent/robust than the repl?

@Mithgol
Copy link
Contributor Author

Mithgol commented Mar 14, 2014

If REPL were to interfere (for example, if REPL were catching errors to display them as ... in its console instead of letting them to be passed to my callback), then yes.

However, REPL does not seem to interfere. The error happens and is passed to my callback.

And I do not intend to use REPL in the node-pre-gyp module. I only needed REPL to run some code to test the require's behaviour in a child process.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants