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

Settings problem with Ruby 1.9 and TheRubyRacer V8. #34

Open
falaise opened this issue May 11, 2011 · 1 comment
Open

Settings problem with Ruby 1.9 and TheRubyRacer V8. #34

falaise opened this issue May 11, 2011 · 1 comment

Comments

@falaise
Copy link

falaise commented May 11, 2011

Hello,

With this little script :

puts " ARGV_0 <#{ARGV.join(", ")}> (#{ARGV.class})"
["foo",2,3,4].each{|p| ARGV.push p}
puts " ARGV_1 <#{ARGV.join(", ")}> (#{ARGV.class})"
begin
puts " $FILENAME <#{$FILENAME}> (#{$FILENAME.class})"
rescue => ex
puts " *** EXCEPTION <#{ex.message}>\n STACK=<#{ex.backtrace.join("\n")}>"
end
puts " ARGV_2 <#{ARGV.join(", ")}> (#{ARGV.class})"

If you start it with Ruby 1.8 you will have :
ARGV_0 <> (Array)
ARGV_1 <foo, 2, 3, 4> (Array)
$FILENAME <-> (String)
ARGV_2 <foo, 2, 3, 4> (Array)
which is right and works with 'bin/envjs rubyracer foo.js' as written in the last line of 'envjs/rubyracer.rb'.

but if you try it with Ruby 1.9 you will have :
ARGV_0 <> (Array)
ARGV_1 <foo, 2, 3, 4> (Array)
*** EXCEPTION <No such file or directory - foo>
STACK=<./this_script.rb:XX:in `

'>
ARGV_2 <2, 3, 4> (Array)
which does not work with 'bin/envjs rubyracer foo.js' as written in the last line of 'envjs/rubyracer.rb'.

I suggest to ignore the global variable '$FILENAME'
Probably you have that problem with all JavaScript engines and Ruby.

Regards.

@thatcher
Copy link
Owner

Thanks!

Sent from my iPhone
Christopher Thatcher
202-340-9685
thatcher.christopher@gmail.com

On May 11, 2011, at 7:05 AM, falaisereply@reply.github.com wrote:

Hello,

With this little script :

puts " ARGV_0 <#{ARGV.join(", ")}> (#{ARGV.class})"
["foo",2,3,4].each{|p| ARGV.push p}
puts " ARGV_1 <#{ARGV.join(", ")}> (#{ARGV.class})"
begin
puts " $FILENAME <#{$FILENAME}> (#{$FILENAME.class})"
rescue => ex
puts " *** EXCEPTION <#{ex.message}>\n STACK=<#{ex.backtrace.join("\n")}>"
end
puts " ARGV_2 <#{ARGV.join(", ")}> (#{ARGV.class})"

If you start it with Ruby 1.8 you will have :
ARGV_0 <> (Array)
ARGV_1 <foo, 2, 3, 4> (Array)
$FILENAME <-> (String)
ARGV_2 <foo, 2, 3, 4> (Array)
which is right and works with 'bin/envjs rubyracer foo.js' as written in the last line of 'envjs/rubyracer.rb'.

but if you try it with Ruby 1.9 you will have :
ARGV_0 <> (Array)
ARGV_1 <foo, 2, 3, 4> (Array)
*** EXCEPTION <No such file or directory - foo>
STACK=<./this_script.rb:XX:in `

'>
ARGV_2 <2, 3, 4> (Array)
which does not work with 'bin/envjs rubyracer foo.js' as written in the last line of 'envjs/rubyracer.rb'.

I suggest to ignore the global variable '$FILENAME'
Probably you have that problem with all JavaScript engines and Ruby.

Regards.

Reply to this email directly or view it on GitHub:
#34

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