@@ -1743,50 +1743,6 @@ public IRubyObject send(ThreadContext context, IRubyObject[] args, Block block)
1743
1743
return getMetaClass ().finvoke (context , this , name , args , block );
1744
1744
}
1745
1745
1746
- @ JRubyMethod (name = "instance_eval" ,
1747
- reads = {LASTLINE , BACKREF , VISIBILITY , BLOCK , SELF , METHODNAME , LINE , CLASS , FILENAME , SCOPE },
1748
- writes = {LASTLINE , BACKREF , VISIBILITY , BLOCK , SELF , METHODNAME , LINE , CLASS , FILENAME , SCOPE })
1749
- public IRubyObject instance_eval19 (ThreadContext context , Block block ) {
1750
- return specificEval (context , getInstanceEvalClass (), block , EvalType .INSTANCE_EVAL );
1751
- }
1752
- @ JRubyMethod (name = "instance_eval" ,
1753
- reads = {LASTLINE , BACKREF , VISIBILITY , BLOCK , SELF , METHODNAME , LINE , CLASS , FILENAME , SCOPE },
1754
- writes = {LASTLINE , BACKREF , VISIBILITY , BLOCK , SELF , METHODNAME , LINE , CLASS , FILENAME , SCOPE })
1755
- public IRubyObject instance_eval19 (ThreadContext context , IRubyObject arg0 , Block block ) {
1756
- return specificEval (context , getInstanceEvalClass (), arg0 , block , EvalType .INSTANCE_EVAL );
1757
- }
1758
- @ JRubyMethod (name = "instance_eval" ,
1759
- reads = {LASTLINE , BACKREF , VISIBILITY , BLOCK , SELF , METHODNAME , LINE , CLASS , FILENAME , SCOPE },
1760
- writes = {LASTLINE , BACKREF , VISIBILITY , BLOCK , SELF , METHODNAME , LINE , CLASS , FILENAME , SCOPE })
1761
- public IRubyObject instance_eval19 (ThreadContext context , IRubyObject arg0 , IRubyObject arg1 , Block block ) {
1762
- return specificEval (context , getInstanceEvalClass (), arg0 , arg1 , block , EvalType .INSTANCE_EVAL );
1763
- }
1764
- @ JRubyMethod (name = "instance_eval" ,
1765
- reads = {LASTLINE , BACKREF , VISIBILITY , BLOCK , SELF , METHODNAME , LINE , CLASS , FILENAME , SCOPE },
1766
- writes = {LASTLINE , BACKREF , VISIBILITY , BLOCK , SELF , METHODNAME , LINE , CLASS , FILENAME , SCOPE })
1767
- public IRubyObject instance_eval19 (ThreadContext context , IRubyObject arg0 , IRubyObject arg1 , IRubyObject arg2 , Block block ) {
1768
- return specificEval (context , getInstanceEvalClass (), arg0 , arg1 , arg2 , block , EvalType .INSTANCE_EVAL );
1769
- }
1770
-
1771
- @ JRubyMethod (name = "instance_exec" , optional = 3 , rest = true ,
1772
- reads = {LASTLINE , BACKREF , VISIBILITY , BLOCK , SELF , METHODNAME , LINE , CLASS , FILENAME , SCOPE },
1773
- writes = {LASTLINE , BACKREF , VISIBILITY , BLOCK , SELF , METHODNAME , LINE , CLASS , FILENAME , SCOPE })
1774
- public IRubyObject instance_exec19 (ThreadContext context , IRubyObject [] args , Block block ) {
1775
- if (!block .isGiven ()) {
1776
- throw context .runtime .newLocalJumpErrorNoBlock ();
1777
- }
1778
-
1779
- RubyModule klazz ;
1780
- if (isImmediate ()) {
1781
- // Ruby uses Qnil here, we use "dummy" because we need a class
1782
- klazz = context .runtime .getDummy ();
1783
- } else {
1784
- klazz = getSingletonClass ();
1785
- }
1786
-
1787
- return yieldUnder (context , klazz , args , block , EvalType .INSTANCE_EVAL );
1788
- }
1789
-
1790
1746
/**
1791
1747
* Will yield to the specific block changing the self to be the
1792
1748
* current object instead of the self that is part of the frame
@@ -2631,19 +2587,49 @@ public RubyArray to_a() {
2631
2587
* k = Klass.new
2632
2588
* k.instance_eval { @secret } #=> 99
2633
2589
*/
2590
+
2591
+ @ JRubyMethod (name = "instance_eval" ,
2592
+ reads = {LASTLINE , BACKREF , VISIBILITY , BLOCK , SELF , METHODNAME , LINE , CLASS , FILENAME , SCOPE },
2593
+ writes = {LASTLINE , BACKREF , VISIBILITY , BLOCK , SELF , METHODNAME , LINE , CLASS , FILENAME , SCOPE })
2634
2594
public IRubyObject instance_eval (ThreadContext context , Block block ) {
2635
2595
return specificEval (context , getInstanceEvalClass (), block , EvalType .INSTANCE_EVAL );
2636
2596
}
2597
+ @ JRubyMethod (name = "instance_eval" ,
2598
+ reads = {LASTLINE , BACKREF , VISIBILITY , BLOCK , SELF , METHODNAME , LINE , CLASS , FILENAME , SCOPE },
2599
+ writes = {LASTLINE , BACKREF , VISIBILITY , BLOCK , SELF , METHODNAME , LINE , CLASS , FILENAME , SCOPE })
2637
2600
public IRubyObject instance_eval (ThreadContext context , IRubyObject arg0 , Block block ) {
2638
2601
return specificEval (context , getInstanceEvalClass (), arg0 , block , EvalType .INSTANCE_EVAL );
2639
2602
}
2603
+ @ JRubyMethod (name = "instance_eval" ,
2604
+ reads = {LASTLINE , BACKREF , VISIBILITY , BLOCK , SELF , METHODNAME , LINE , CLASS , FILENAME , SCOPE },
2605
+ writes = {LASTLINE , BACKREF , VISIBILITY , BLOCK , SELF , METHODNAME , LINE , CLASS , FILENAME , SCOPE })
2640
2606
public IRubyObject instance_eval (ThreadContext context , IRubyObject arg0 , IRubyObject arg1 , Block block ) {
2641
2607
return specificEval (context , getInstanceEvalClass (), arg0 , arg1 , block , EvalType .INSTANCE_EVAL );
2642
2608
}
2609
+ @ JRubyMethod (name = "instance_eval" ,
2610
+ reads = {LASTLINE , BACKREF , VISIBILITY , BLOCK , SELF , METHODNAME , LINE , CLASS , FILENAME , SCOPE },
2611
+ writes = {LASTLINE , BACKREF , VISIBILITY , BLOCK , SELF , METHODNAME , LINE , CLASS , FILENAME , SCOPE })
2643
2612
public IRubyObject instance_eval (ThreadContext context , IRubyObject arg0 , IRubyObject arg1 , IRubyObject arg2 , Block block ) {
2644
2613
return specificEval (context , getInstanceEvalClass (), arg0 , arg1 , arg2 , block , EvalType .INSTANCE_EVAL );
2645
2614
}
2646
2615
2616
+ @ Deprecated
2617
+ public IRubyObject instance_eval19 (ThreadContext context , Block block ) {
2618
+ return specificEval (context , getInstanceEvalClass (), block , EvalType .INSTANCE_EVAL );
2619
+ }
2620
+ @ Deprecated
2621
+ public IRubyObject instance_eval19 (ThreadContext context , IRubyObject arg0 , Block block ) {
2622
+ return specificEval (context , getInstanceEvalClass (), arg0 , block , EvalType .INSTANCE_EVAL );
2623
+ }
2624
+ @ Deprecated
2625
+ public IRubyObject instance_eval19 (ThreadContext context , IRubyObject arg0 , IRubyObject arg1 , Block block ) {
2626
+ return specificEval (context , getInstanceEvalClass (), arg0 , arg1 , block , EvalType .INSTANCE_EVAL );
2627
+ }
2628
+ @ Deprecated
2629
+ public IRubyObject instance_eval19 (ThreadContext context , IRubyObject arg0 , IRubyObject arg1 , IRubyObject arg2 , Block block ) {
2630
+ return specificEval (context , getInstanceEvalClass (), arg0 , arg1 , arg2 , block , EvalType .INSTANCE_EVAL );
2631
+ }
2632
+
2647
2633
/** rb_obj_instance_exec
2648
2634
*
2649
2635
* call-seq:
@@ -2662,9 +2648,12 @@ public IRubyObject instance_eval(ThreadContext context, IRubyObject arg0, IRubyO
2662
2648
* k = Klass.new
2663
2649
* k.instance_exec(5) {|x| @secret+x } #=> 104
2664
2650
*/
2651
+ @ JRubyMethod (name = "instance_exec" , optional = 3 , rest = true ,
2652
+ reads = {LASTLINE , BACKREF , VISIBILITY , BLOCK , SELF , METHODNAME , LINE , CLASS , FILENAME , SCOPE },
2653
+ writes = {LASTLINE , BACKREF , VISIBILITY , BLOCK , SELF , METHODNAME , LINE , CLASS , FILENAME , SCOPE })
2665
2654
public IRubyObject instance_exec (ThreadContext context , IRubyObject [] args , Block block ) {
2666
2655
if (!block .isGiven ()) {
2667
- throw context .runtime .newArgumentError ( "block not supplied" );
2656
+ throw context .runtime .newLocalJumpErrorNoBlock ( );
2668
2657
}
2669
2658
2670
2659
RubyModule klazz ;
@@ -2678,6 +2667,11 @@ public IRubyObject instance_exec(ThreadContext context, IRubyObject[] args, Bloc
2678
2667
return yieldUnder (context , klazz , args , block , EvalType .INSTANCE_EVAL );
2679
2668
}
2680
2669
2670
+ @ Deprecated
2671
+ public IRubyObject instance_exec19 (ThreadContext context , IRubyObject [] args , Block block ) {
2672
+ return instance_exec (context , args , block );
2673
+ }
2674
+
2681
2675
/** rb_obj_extend
2682
2676
*
2683
2677
* call-seq:
0 commit comments