jruby 9.1.12.0 (2.3.3) 2017-06-15 33c6439 Java HotSpot(TM) 64-Bit Server VM 24.80-b11 on 1.7.0_80-b15 +jit [darwin-x86_64]
Darwin mac-mini.local 15.6.0 Darwin Kernel Version 15.6.0: Mon Jan 9 23:07:29 PST 2017; root:xnu-3248.60.11.2.1~1/RELEASE_X86_64 x86_64
Actual Behavior
OK:
% jruby main.rb
"9.1.12.0"
Warning:
% jruby -rdebug main.rb
Debug.rb
Emacs support available.
/Users/xxxxxx/.rbenv/versions/jruby-9.1.12.0/lib/ruby/stdlib/debug.rb:1114: warning: tracing
(e.g. set_trace_func) will not capture all events without --debug flag
"9.1.12.0"
Error:
% jruby --debug -rdebug main.rb
Debug.rb
Emacs support available.
TypeError: no implicit conversion of Symbol into Integer
[] at org/jruby/RubyArray.java:1458
context at /Users/xxxxxx/.rbenv/versions/jruby-9.1.12.0/lib/ruby/stdlib/debug.rb:982
block in suspend at /Users/xxxxxx/.rbenv/versions/jruby-9.1.12.0/lib/ruby/stdlib/debug.rb:958
each at org/jruby/RubyHash.java:1343
block in suspend at /Users/xxxxxx/.rbenv/versions/jruby-9.1.12.0/lib/ruby/stdlib/debug.rb:956
synchronize at org/jruby/ext/thread/Mutex.java:148
suspend at /Users/xxxxxx/.rbenv/versions/jruby-9.1.12.0/lib/ruby/stdlib/debug.rb:954
suspend_all at /Users/xxxxxx/.rbenv/versions/jruby-9.1.12.0/lib/ruby/stdlib/debug.rb:237
trace_func at /Users/xxxxxx/.rbenv/versions/jruby-9.1.12.0/lib/ruby/stdlib/debug.rb:865
block in DEBUGGER__ at /Users/xxxxxx/.rbenv/versions/jruby-9.1.12.0/lib/ruby/stdlib/debug.rb:1115
<main> at main.rb:1
The text was updated successfully, but these errors were encountered:
wowie zowie!!! So glancing at this it would appear in most cases we pass in nothing or just the thread to context but SOMETIMES we pass in [thread, 1]. Very weird. In an award for most esoteric Ruby syntax of 2017 (and believe me I thought I knew pretty much all weird Ruby syntax):
Notice that ','? HAHAH so JRuby does not destructure the array because of that comma and passes the array through as th. It should just pass the first element. Trivial repro:
This is really about fixing:
```ruby
@t = [[1, 2], [3, 4]]
for th, in @t
p th
end
```
which stdlib debug happens to use (notice the extra ,). Spec commit coming
after this one.
main.rb
Environment
jruby 9.1.12.0 (2.3.3) 2017-06-15 33c6439 Java HotSpot(TM) 64-Bit Server VM 24.80-b11 on 1.7.0_80-b15 +jit [darwin-x86_64]
Darwin mac-mini.local 15.6.0 Darwin Kernel Version 15.6.0: Mon Jan 9 23:07:29 PST 2017; root:xnu-3248.60.11.2.1~1/RELEASE_X86_64 x86_64
Actual Behavior
OK:
Warning:
Error:
The text was updated successfully, but these errors were encountered: