Skip to content

Commit f37dc99

Browse files
committed
[Truffle] Fix another Exception#to_s spec.
1 parent 61ad8cf commit f37dc99

File tree

1 file changed

+3
-7
lines changed

1 file changed

+3
-7
lines changed

truffle/src/main/java/org/jruby/truffle/nodes/core/ExceptionNodes.java

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -34,18 +34,14 @@ public InitializeNode(RubyContext context, SourceSection sourceSection) {
3434

3535
@Specialization
3636
public RubyBasicObject initialize(RubyException exception, UndefinedPlaceholder message) {
37-
CompilerDirectives.transferToInterpreter();
38-
3937
exception.initialize(nil());
40-
return nil();
38+
return exception;
4139
}
4240

43-
@Specialization
41+
@Specialization(guards = "!isUndefinedPlaceholder(message)")
4442
public RubyBasicObject initialize(RubyException exception, Object message) {
45-
CompilerDirectives.transferToInterpreter();
46-
4743
exception.initialize(message);
48-
return nil();
44+
return exception;
4945
}
5046

5147
}

0 commit comments

Comments
 (0)