Conrad Irwin created JRUBY-6473:
-----------------------------------

             Summary: __LINE__ is incorrect when using eval() with binding 
objects.
                 Key: JRUBY-6473
                 URL: https://jira.codehaus.org/browse/JRUBY-6473
             Project: JRuby
          Issue Type: Bug
          Components: Core Classes/Modules, RubySpec
            Reporter: Conrad Irwin
            Priority: Minor


MRI has traditionally preserved the value of __LINE__ inside binding objects; a 
fact that is relied on by Pry to discover where the user "is" in relation to 
their source-code. (https://github.com/pry/pry/issues/475). Jruby nearly 
implements this, but it relies on binding.getFrame().getLine() (as of 
c9acf3b44b5651dd9a7f483b2a425dc25bfe1998), which unfortunately seems not to 
point to the line currently being executed.

To get round this problem it's possible to instead use the same information as 
used to populate the caller() array, 
https://github.com/ConradIrwin/jruby/commit/e1272dc07455a34dfca063b9a82a6819295cdee8,
 though I'm sure there are better ways.

To get this code: git pull https://github.com/ConradIrwin/jruby.git 
bug/line-in-binding

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: 
https://jira.codehaus.org/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email


Reply via email to