Project

General

Profile

Actions

Bug #14057

closed

TracePoint#enable and disable should not yield arguments

Added by marcandre (Marc-Andre Lafortune) over 6 years ago. Updated about 6 years ago.

Status:
Closed
Target version:
ruby -v:
trunk
[ruby-core:83572]

Description

While working on RubySpecs with Atul Bhosale, we discovered that TracePoint#enable and #disable yield nil instead of not yielding any argument.

This is mostly harmless as we usually use blocks, but it could create issues for lambdas/methods, for example:

def handle_trace; end

TracePoint.new{}.enable(&method(:handle_trace)) # => ArgumentError: wrong number of arguments (given 1, expected 0)

I'm fixing in trunk, would be nice to backport.

Actions

Also available in: Atom PDF

Like0
Like0Like0Like0