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

.eval works in repl but not in script #4011

Closed
ccorcos opened this issue Jun 11, 2015 · 3 comments
Closed

.eval works in repl but not in script #4011

ccorcos opened this issue Jun 11, 2015 · 3 comments

Comments

@ccorcos
Copy link

ccorcos commented Jun 11, 2015

The following works from the coffeescript REPL but doesnt work if I put it in a file and run it. It says that "a is not defined"

Coffee = require 'coffee-script'
a = {b: 1}
console.log Coffee.eval('a.b')
@ccorcos
Copy link
Author

ccorcos commented Jun 11, 2015

Also, is there any documentation on .eval? I couldn't find any...

@ccorcos
Copy link
Author

ccorcos commented Jun 12, 2015

Hmm. sandbox is what I needed:

https://github.com/jashkenas/coffeescript/blob/master/src/coffee-script.coffee#L144

I'll leave this issue open for the moment, because I think this ought to be documented

@GeoffreyBooth
Copy link
Collaborator

These are methods for internal use in the REPL.

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

No branches or pull requests

2 participants