Project

General

Profile

Bug #15481 ยป no-method-error-receiver.patch

zverok (Victor Shepelev), 12/29/2018 10:21 AM

View differences:

error.c
1451 1451

  
1452 1452
/*
1453 1453
 * call-seq:
1454
 *   NameError.new(msg [, name])  -> name_error
1455
 *   NameError.new(msg [, name], receiver:)  -> name_error
1454
 *   NameError.new(msg=nil, name=nil, receiver: nil)  -> name_error
1456 1455
 *
1457 1456
 * Construct a new NameError exception. If given the <i>name</i>
1458 1457
 * parameter may subsequently be examined using the <code>NameError#name</code>
1459
 * method.
1458
 * method. <i>receiver</i> parameter allows to pass object in
1459
 * context of which the error happened. Example:
1460
 *
1461
 *    [1, 2, 3].method(:rject) # NameError with name "rject" and receiver: Array
1462
 *    [1, 2, 3].singleton_method(:rject) # NameError with name "rject" and receiver: [1, 2, 3]
1460 1463
 */
1461 1464

  
1462 1465
static VALUE
......
1535 1538

  
1536 1539
/*
1537 1540
 * call-seq:
1538
 *   NoMethodError.new([msg, *, name [, args [, priv]]])  -> no_method_error
1541
 *   NoMethodError.new(msg=nil, name=nil, args=nil, private=false, receiver: nil)  -> no_method_error
1539 1542
 *
1540 1543
 * Construct a NoMethodError exception for a method of the given name
1541 1544
 * called with the given arguments. The name may be accessed using
1542 1545
 * the <code>#name</code> method on the resulting object, and the
1543 1546
 * arguments using the <code>#args</code> method.
1547
 *
1548
 * If <i>private</i> argument were passed, it designates method was
1549
 * attempted to call in private context, and can be accessed with
1550
 * <code>#private_call?</code> method.
1551
 *
1552
 * <i>receiver</i> argument stores an object whose method was called.
1544 1553
 */
1545 1554

  
1546 1555
static VALUE