File tree Expand file tree Collapse file tree 1 file changed +5
-4
lines changed
src/main/java/org/truffleruby/core/kernel Expand file tree Collapse file tree 1 file changed +5
-4
lines changed Original file line number Diff line number Diff line change @@ -999,11 +999,12 @@ public abstract static class LambdaNode extends CoreMethodArrayArgumentsNode {
999
999
1000
1000
@ TruffleBoundary
1001
1001
@ Specialization
1002
- public DynamicObject lambda (NotProvided block ) {
1003
- final Frame parentFrame = getContext ().getCallStack ().getCallerFrameIgnoringSend (0 ).getFrame (FrameAccess .READ_ONLY );
1004
- final DynamicObject parentBlock = RubyArguments .getBlock (parentFrame );
1002
+ public DynamicObject lambda (NotProvided block ,
1003
+ @ Cached ("create(nil())" ) FindAndReadDeclarationVariableNode readNode ) {
1004
+ final MaterializedFrame parentFrame = getContext ().getCallStack ().getCallerFrameIgnoringSend (0 ).getFrame (FrameAccess .MATERIALIZE ).materialize ();
1005
+ DynamicObject parentBlock = (DynamicObject ) readNode .execute (parentFrame , TranslatorEnvironment .METHOD_BLOCK_NAME );
1005
1006
1006
- if (parentBlock == null ) {
1007
+ if (parentBlock == nil () ) {
1007
1008
throw new RaiseException (getContext (), coreExceptions ().argumentError ("tried to create Proc object without a block" , this ));
1008
1009
} else {
1009
1010
warnProcWithoutBlock ();
You can’t perform that action at this time.
0 commit comments