File tree Expand file tree Collapse file tree 2 files changed +18
-1
lines changed
core/src/main/java/org/jruby/truffle/nodes/core
spec/truffle/tags/core/nil Expand file tree Collapse file tree 2 files changed +18
-1
lines changed Original file line number Diff line number Diff line change 12
12
import com .oracle .truffle .api .source .*;
13
13
import com .oracle .truffle .api .dsl .*;
14
14
import org .jruby .truffle .runtime .*;
15
+ import org .jruby .truffle .runtime .control .RaiseException ;
15
16
import org .jruby .truffle .runtime .core .*;
16
17
17
18
@ CoreClass (name = "NilClass" )
@@ -119,6 +120,23 @@ public RubyString toS() {
119
120
}
120
121
}
121
122
123
+ @ CoreMethod (names = "dup" , needsSelf = false )
124
+ public abstract static class DupNode extends CoreMethodNode {
125
+
126
+ public DupNode (RubyContext context , SourceSection sourceSection ) {
127
+ super (context , sourceSection );
128
+ }
129
+
130
+ public DupNode (DupNode prev ) {
131
+ super (prev );
132
+ }
133
+
134
+ @ Specialization
135
+ public RubyString dup () {
136
+ throw new RaiseException (getContext ().getCoreLibrary ().typeError ("can't dup NilClass" , this ));
137
+ }
138
+ }
139
+
122
140
@ CoreMethod (names = "&" , needsSelf = false , required = 1 )
123
141
public abstract static class AndNode extends CoreMethodNode {
124
142
Load Diff This file was deleted.
You can’t perform that action at this time.
0 commit comments