1. 26 Jun, 2021 1 commit
    • dearblue's avatar
      Fixed finding variables from `proc` in `binding.eval` failed · c182903e
      dearblue authored
      Previously the following code did not produce the expected results:
      ```ruby
      bx = binding
      block = bx.eval("a = 1; proc { a }")
      bx.eval("a = 2")
      p block.call  # Expect 2 but return 1 due to a bug
      ```
      
      The previous implementation of `Binding#eval` evaluated the code and then merged the top layer variables.
      This patch will parse and expand the variable space before making a call to `eval`.
      This means that the call to `Binding#eval` will do the parsing twice.
      
      In addition, the following changes will be made:
      - Make `mrb_parser_foreach_top_variable()`, `mrb_binding_extract_proc()` and `mrb_binding_extract_env()` functions private global functions.
      - Remove the `posthook` argument from `mrb_exec_irep()`.
        The `posthook` argument was introduced to implement the `binding` method.
        This patch is unnecessary because it uses a different implementation method.
      
      ref #5362
      fixed #5491
      c182903e
  2. 25 Jun, 2021 1 commit
  3. 24 Jun, 2021 2 commits
  4. 23 Jun, 2021 2 commits
  5. 22 Jun, 2021 4 commits
  6. 21 Jun, 2021 3 commits
  7. 20 Jun, 2021 2 commits
  8. 19 Jun, 2021 4 commits
  9. 18 Jun, 2021 2 commits
  10. 17 Jun, 2021 12 commits
  11. 16 Jun, 2021 5 commits
  12. 15 Jun, 2021 2 commits