Details
-
Type:
Bug
-
Status:
Resolved
-
Priority:
Major
-
Resolution: Fixed
-
Affects Version/s: JRuby 1.7.0.pre1
-
Fix Version/s: JRuby 1.7.0.pre2
-
Component/s: Interpreter
-
Labels:None
-
Number of attachments :
Description
The bug causes an error form Nokogiri's 1.9 mode. Also, the bug is reported in issue#657, https://github.com/sparklemotion/nokogiri/issues/657 .
Please look at seplist method in lib/ruby/1.9/pp.rb, line 214-225. A given argument as "list" looks like this:
[[:name, "html"]]
This turns out *v should be [:name, "html"] . In seplist method, the value of *v is a correct one, [:name, "html"]. However, in the given block, (the first) argument is :name only. The "yield" method, line#223, is suspicious.
Nokogiri uses seplist method in lib/nokogiri/xml/pp/node.rb, https://github.com/sparklemotion/nokogiri/blob/master/lib/nokogiri/xml/pp/node.rb, line#36-48.
On JRuby 1.9, "v" in Nokogiri's pretty_print method, line#37 in https://github.com/sparklemotion/nokogiri/blob/master/lib/nokogiri/xml/pp/node.rb , isn't an Array and doesn't have first method. Then, an error is thrown from here.
Just my guess, org.jruby.ast.Yield19Node.interpret() method might do something wrong. In switch statement, args.getNodeType() matched to "case SPLATNODE" against [:name, "html"] .
This pp issue doesn't exist on 1.8 mode.