Skip to content
  • Alan Wu's avatar
    39ee3e22
    Make Kernel#lambda raise when given non-literal block · 39ee3e22
    Alan Wu authored
    
    
    Previously, Kernel#lambda returned a non-lambda proc when given a
    non-literal block and issued a warning under the `:deprecated` category.
    With this change, Kernel#lambda will always return a lambda proc, if it
    returns without raising.
    
    Due to interactions with block passing optimizations, we previously had
    two separate code paths for detecting whether Kernel#lambda got a
    literal block. This change allows us to remove one path, the hack done
    with rb_control_frame_t::block_code introduced in 85a337f9 for supporting
    situations where Kernel#lambda returned a non-lambda proc.
    
    [Feature #19777]
    
    Co-authored-by: default avatarTakashi Kokubun <takashikkbn@gmail.com>
    39ee3e22
    Make Kernel#lambda raise when given non-literal block
    Alan Wu authored
    
    
    Previously, Kernel#lambda returned a non-lambda proc when given a
    non-literal block and issued a warning under the `:deprecated` category.
    With this change, Kernel#lambda will always return a lambda proc, if it
    returns without raising.
    
    Due to interactions with block passing optimizations, we previously had
    two separate code paths for detecting whether Kernel#lambda got a
    literal block. This change allows us to remove one path, the hack done
    with rb_control_frame_t::block_code introduced in 85a337f9 for supporting
    situations where Kernel#lambda returned a non-lambda proc.
    
    [Feature #19777]
    
    Co-authored-by: default avatarTakashi Kokubun <takashikkbn@gmail.com>
Loading