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

Isn't happy working with Node.js #5

Open
presidentbeef opened this issue May 9, 2013 · 3 comments
Open

Isn't happy working with Node.js #5

presidentbeef opened this issue May 9, 2013 · 3 comments

Comments

@presidentbeef
Copy link
Contributor

Sadness:

1.9.3-p392 :001 > require 'esprima'
 => true
1.9.3-p392 :002 > Esprima::Parser.new
TypeError: nil is not a symbol
    from /Users/collins/.rvm/gems/ruby-1.9.3-p392@coffeebreak/gems/esprima-1.4.2/lib/esprima.rb:30:in `instance_variable_get'
    from /Users/collins/.rvm/gems/ruby-1.9.3-p392@coffeebreak/gems/esprima-1.4.2/lib/esprima.rb:30:in `new_context'
    from /Users/collins/.rvm/gems/ruby-1.9.3-p392@coffeebreak/gems/esprima-1.4.2/lib/esprima.rb:20:in `new_environment'
    from /Users/collins/.rvm/gems/ruby-1.9.3-p392@coffeebreak/gems/esprima-1.4.2/lib/esprima/parser.rb:6:in `initialize'
    from (irb):2:in `new'
    from (irb):2
    from /Users/collins/.rvm/rubies/ruby-1.9.3-p392/bin/irb:16:in `<main>'

The context seems to not include the expected stuff:

1.9.3-p392 :001 > require 'execjs'
 => true
1.9.3-p392 :002 > ExecJS.runtime.class::Context.new(nil)
 => #<ExecJS::ExternalRuntime::Context:0x007fcdaa328140 @runtime=nil, @source="">
1.9.3-p392 :003 > ExecJS.runtime
 => #<ExecJS::ExternalRuntime:0x007fcda988cf38 @name="Node.js (V8)", @command=["nodejs", "node"], @runner_path="/Users/collins/.rvm/gems/ruby-1.9.3-p392@coffeebreak/gems/execjs-1.4.0/lib/execjs/support/node_runner.js", @test_args=nil, @test_match=nil, @encoding="UTF-8", @deprecated=false, @binary="node">

🎷

@camertron
Copy link
Owner

Hey @presidentbeef I haven't had time to look into this issue, sorry about that. Probably won't have much time in the future either - any ideas?

@presidentbeef
Copy link
Contributor Author

I'll take a look into this. Looks like Esprima is pulling the context out of ExecJS and passing it to CommonJS. But when ExecJS loads node.js, it doesn't have a "context" because it's an ExternalRuntime. Not sure this can be resolved.

@camertron
Copy link
Owner

Yeah, I fiddled with this a bit as well and couldn't figure it out. I believe there are a few similar issues filed against ExecJS, but no satisfactory answers yet :(

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