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

Correct Binding#dup to properly propagate values it captures #7688

Merged
merged 8 commits into from
May 2, 2024

Commits on Feb 23, 2023

  1. Try and appease the eval+binding gods

    When we eval with binding we will construct a new binding that
    contains the original binding and that original binding will
    construct a new evalDynamicScope.  If I do something like:
    
    ```ruby
    p TOPLEVEL_BINDING.local_variable_defined? :c
    p TOPLEVEL_BINDING.local_variable_defined? :_xxx_var_
    
    b =TOPLEVEL_BINDING.dup
    p b.local_variable_defined? :c
    p b.local_variable_defined? :_xxx_var_
    ```
    
    I should still see _xxx_var_ after the dup.  This will make that
    do that but two different RubyBinding instances will end up
    with the exact same backing Binding and I think this is wrong.
    Landing anyways to see if anything breaks.
    enebo committed Feb 23, 2023
    Configuration menu
    Copy the full SHA
    f304def View commit details
    Browse the repository at this point in the history

Commits on Apr 30, 2024

  1. Configuration menu
    Copy the full SHA
    e74990f View commit details
    Browse the repository at this point in the history

Commits on May 1, 2024

  1. Configuration menu
    Copy the full SHA
    4c1473a View commit details
    Browse the repository at this point in the history
  2. dup will dup binding state already saved so it will keep variable val…

    …ues but they will be their own thing from that point onward
    enebo committed May 1, 2024
    Configuration menu
    Copy the full SHA
    d994845 View commit details
    Browse the repository at this point in the history
  3. bindings can change size..just making sure this fixes issues. I likel…

    …y will rename this from dup
    enebo committed May 1, 2024
    Configuration menu
    Copy the full SHA
    2b9b9d9 View commit details
    Browse the repository at this point in the history
  4. Configuration menu
    Copy the full SHA
    0cc945b View commit details
    Browse the repository at this point in the history

Commits on May 2, 2024

  1. Configuration menu
    Copy the full SHA
    eb73e3b View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    1fdac51 View commit details
    Browse the repository at this point in the history