Skip to content

Commit

Permalink
Showing 4 changed files with 20 additions and 3 deletions.

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
@@ -297,7 +297,7 @@ public RubySymbol calleeName(VirtualFrame frame) {
}
}

@CoreMethod(names = "caller_locations", isModuleFunction = true, optional = 2)
@CoreMethod(names = "caller_locations", isModuleFunction = true, optional = 2, lowerFixnumParameters = {0, 1})
public abstract static class CallerLocationsNode extends CoreMethodArrayArgumentsNode {

public CallerLocationsNode(RubyContext context, SourceSection sourceSection) {
Original file line number Diff line number Diff line change
@@ -88,6 +88,25 @@ public RubyString absolutePath(RubyBasicObject threadBacktraceLocation) {

}

@CoreMethod(names = "lineno")
public abstract static class LinenoNode extends UnaryCoreMethodNode {

public LinenoNode(RubyContext context, SourceSection sourceSection) {
super(context, sourceSection);
}

@CompilerDirectives.TruffleBoundary
@Specialization
public int lineno(RubyBasicObject threadBacktraceLocation) {
final Activation activation = getActivation(threadBacktraceLocation);

final SourceSection sourceSection = activation.getCallNode().getEncapsulatingSourceSection();

return sourceSection.getStartLine();
}

}

@CoreMethod(names = {"to_s", "inspect"})
public abstract static class ToSNode extends UnaryCoreMethodNode {

0 comments on commit 1457605

Please sign in to comment.