|
31 | 31 | import org.truffleruby.core.symbol.SymbolNodes;
|
32 | 32 | import org.truffleruby.language.Nil;
|
33 | 33 | import org.truffleruby.language.Visibility;
|
34 |
| -import org.truffleruby.language.WarnNode; |
35 | 34 | import org.truffleruby.language.arguments.ArgumentDescriptorUtils;
|
36 |
| -import org.truffleruby.language.arguments.ReadCallerFrameNode; |
37 | 35 | import org.truffleruby.language.arguments.RubyArguments;
|
38 | 36 | import org.truffleruby.language.control.RaiseException;
|
39 | 37 | import org.truffleruby.language.dispatch.DispatchNode;
|
40 |
| -import org.truffleruby.language.locals.FindDeclarationVariableNodes.FindAndReadDeclarationVariableNode; |
41 | 38 | import org.truffleruby.language.methods.Arity;
|
42 | 39 | import org.truffleruby.language.objects.AllocationTracing;
|
43 | 40 | import org.truffleruby.language.objects.LogicalClassNode;
|
44 | 41 | import org.truffleruby.language.yield.CallBlockNode;
|
45 | 42 | import org.truffleruby.parser.ArgumentDescriptor;
|
46 |
| -import org.truffleruby.parser.TranslatorEnvironment; |
47 | 43 |
|
48 | 44 | import com.oracle.truffle.api.CompilerDirectives.TruffleBoundary;
|
49 | 45 | import com.oracle.truffle.api.dsl.Cached;
|
@@ -75,27 +71,8 @@ public static ProcNewNode create() {
|
75 | 71 | public abstract RubyProc executeProcNew(VirtualFrame frame, RubyClass procClass, Object[] args, Object block);
|
76 | 72 |
|
77 | 73 | @Specialization
|
78 |
| - protected RubyProc proc(VirtualFrame frame, RubyClass procClass, Object[] args, Nil block, |
79 |
| - @Cached FindAndReadDeclarationVariableNode readNode, |
80 |
| - @Cached ReadCallerFrameNode readCaller, |
81 |
| - @Cached ProcNewNode recurseNode, |
82 |
| - @Cached("new()") WarnNode warnNode) { |
83 |
| - final MaterializedFrame parentFrame = readCaller.execute(frame); |
84 |
| - |
85 |
| - Object parentBlock = readNode.execute(parentFrame, TranslatorEnvironment.METHOD_BLOCK_NAME, nil); |
86 |
| - |
87 |
| - if (parentBlock == nil) { |
88 |
| - throw new RaiseException(getContext(), coreExceptions().argumentErrorProcWithoutBlock(this)); |
89 |
| - } else { |
90 |
| - if (warnNode.shouldWarnForDeprecation()) { |
91 |
| - warnNode.warningMessage( |
92 |
| - getContext().getCallStack().getTopMostUserSourceSection(), |
93 |
| - "Capturing the given block using Kernel#proc is deprecated; use `&block` instead"); |
94 |
| - } |
95 |
| - |
96 |
| - final RubyProc proc = (RubyProc) parentBlock; |
97 |
| - return recurseNode.executeProcNew(frame, procClass, args, proc); |
98 |
| - } |
| 74 | + protected RubyProc proc(VirtualFrame frame, RubyClass procClass, Object[] args, Nil block) { |
| 75 | + throw new RaiseException(getContext(), coreExceptions().argumentErrorProcWithoutBlock(this)); |
99 | 76 | }
|
100 | 77 |
|
101 | 78 | @Specialization(guards = { "procClass == getProcClass()", "block.getShape() == getProcShape()" })
|
|
0 commit comments