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

CLI: --require options doesn't work for file with illegal chars for JS variable #4209

Closed
ryoqun opened this issue Feb 23, 2016 · 3 comments
Closed
Labels

Comments

@ryoqun
Copy link

ryoqun commented Feb 23, 2016

The following snippet tells everything...

$ echo 'console.log "hi"' > /tmp/hello-world.coffee
$ echo 'console.log "hi"' > /tmp/hello_world.coffee
$ coffee -r /tmp/hello_world.coffee -e 'console.log("eval")'
hi
eval
$ coffee -r /tmp/hello-world.coffee -e 'console.log("eval")'
ReferenceError: hello is not defined
@ryoqun
Copy link
Author

ryoqun commented Feb 23, 2016

By the way, this is causing the bug in the wild: https://github.com/benbria/coffee-coverage/blob/master/register-istanbul.js

This register file can't be required right way....

@ryoqun
Copy link
Author

ryoqun commented Oct 20, 2016

Hooray for new release!!

So, I'm bumping this just to remind others.. :)

@GeoffreyBooth GeoffreyBooth changed the title --require options doesn't work for file with illegal chars for JS variable CLI: --require options doesn't work for file with illegal chars for JS variable May 6, 2017
GeoffreyBooth added a commit to GeoffreyBooth/coffeescript that referenced this issue Aug 23, 2017
… required file/module is a valid identifier name before assigning to it; fixes jashkenas#4209
GeoffreyBooth added a commit that referenced this issue Aug 23, 2017
…#4658)

* When using --require, check that the variable we’re creating from the required file/module is a valid identifier name before assigning to it; fixes #4209

* We don’t need no stinkin’ regex
@GeoffreyBooth
Copy link
Collaborator

Fixed by #4658.

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

No branches or pull requests

2 participants