Project

General

Profile

Bug #13074

When executing instance_exec with symbol.to_proc, it ignores first argument.

Added by alpaca-tc (Hiroyuki Ishii) over 2 years ago. Updated over 2 years ago.

Status:
Closed
Priority:
Normal
Assignee:
-
Target version:
-
[ruby-core:78839]

Description

Is this intentional?

# Ruby 2.3.3
« instance_exec(1) { |i| i.itself }
=> 1
« instance_exec(1, &:itself)
=> 1

# Ruby 2.4.0
« instance_exec(1) { |i| i.itself }
=> 1
« instance_exec(1, &:itself)
=> main

Related issues

Related to Ruby trunk - Bug #13370: instance_exec occurs "no receiver given (ArgumentError)"RejectedActions
Has duplicate Ruby trunk - Bug #13087: Regression of instance_exec behaviour in ruby 2.4ClosedActions

Associated revisions

Revision af2670f1
Added by nobu (Nobuyoshi Nakada) over 2 years ago

vm_eval.c: Symbol#to_proc and instance_exec

  • vm_eval.c (yield_under): should evaluate the proc on the first argument. [ruby-core:78839] [Bug #13074]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@57194 b2dd03c8-39d4-4d8f-98ff-823fe69b080e

Revision 57194
Added by nobu (Nobuyoshi Nakada) over 2 years ago

vm_eval.c: Symbol#to_proc and instance_exec

  • vm_eval.c (yield_under): should evaluate the proc on the first argument. [ruby-core:78839] [Bug #13074]

Revision 57194
Added by nobu (Nobuyoshi Nakada) over 2 years ago

vm_eval.c: Symbol#to_proc and instance_exec

  • vm_eval.c (yield_under): should evaluate the proc on the first argument. [ruby-core:78839] [Bug #13074]

Revision 57194
Added by nobu (Nobuyoshi Nakada) over 2 years ago

vm_eval.c: Symbol#to_proc and instance_exec

  • vm_eval.c (yield_under): should evaluate the proc on the first argument. [ruby-core:78839] [Bug #13074]

Revision 927c116d
Added by naruse (Yui NARUSE) over 2 years ago

merge revision(s) 57194: [Backport #13074]

    vm_eval.c: Symbol#to_proc and instance_exec

    * vm_eval.c (yield_under): should evaluate the proc on the first
      argument.  [ruby-core:78839] [Bug #13074]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_2_4@57834 b2dd03c8-39d4-4d8f-98ff-823fe69b080e

Revision 57834
Added by naruse (Yui NARUSE) over 2 years ago

merge revision(s) 57194: [Backport #13074]

vm_eval.c: Symbol#to_proc and instance_exec

* vm_eval.c (yield_under): should evaluate the proc on the first
  argument.  [ruby-core:78839] [Bug #13074]

History

Updated by alpaca-tc (Hiroyuki Ishii) over 2 years ago

  • Subject changed from When execute instance_exec with symbol.to_proc, it ignores first argument. to When executing instance_exec with symbol.to_proc, it ignores first argument.
#2

Updated by nobu (Nobuyoshi Nakada) over 2 years ago

  • Status changed from Open to Closed

Applied in changeset r57194.


vm_eval.c: Symbol#to_proc and instance_exec

  • vm_eval.c (yield_under): should evaluate the proc on the first argument. [ruby-core:78839] [Bug #13074]
#3

Updated by nobu (Nobuyoshi Nakada) over 2 years ago

  • Has duplicate Bug #13087: Regression of instance_exec behaviour in ruby 2.4 added

Updated by naruse (Yui NARUSE) over 2 years ago

  • Backport changed from 2.1: UNKNOWN, 2.2: UNKNOWN, 2.3: UNKNOWN, 2.4: UNKNOWN to 2.1: DONTNEED, 2.2: DONTNEED, 2.3: DONTNEED, 2.4: REQUIRED

Updated by naruse (Yui NARUSE) over 2 years ago

  • Backport changed from 2.1: DONTNEED, 2.2: DONTNEED, 2.3: DONTNEED, 2.4: REQUIRED to 2.1: DONTNEED, 2.2: DONTNEED, 2.3: DONTNEED, 2.4: DONE

ruby_2_4 r57834 merged revision(s) 57194.

#6

Updated by nobu (Nobuyoshi Nakada) about 2 years ago

  • Related to Bug #13370: instance_exec occurs "no receiver given (ArgumentError)" added

Also available in: Atom PDF