Remove CallFrame.to_string

The desired string format for a CallFrame may differ between
applications using it. Inko itself does not use CallFrame.to_string
either, so let's just get rid of it.
parent e10bee15
......@@ -2,7 +2,6 @@
#
# This module provides various facilities for debugging programs during
# runtime, such as obtaining stack traces.
import std::conversion::ToString
import std::fs::path::(Path, ToPath)
import std::string_buffer::StringBuffer
......@@ -39,21 +38,6 @@ object CallFrame {
}
}
impl ToString for CallFrame {
# Formats the CallFrame as a String
def to_string -> String {
let buffer = StringBuffer.new(
@path.to_string.inspect,
', line ',
@line.to_string,
', in ',
@name.inspect,
)
buffer.to_string
}
}
# Returns a stack trace leading up to the line that called this method.
#
# The stack trace is returned in reverse order. This means that the most recent
......
......@@ -27,14 +27,6 @@ test.group('std::debug::CallFrame.line') do (g) {
}
}
test.group('std::debug::CallFrame.to_string') do (g) {
g.test('Converting a CallFrame to a String') {
let frame = CallFrame.new(path: 'foo.inko', name: 'foo', line: 1)
assert.equal(frame.to_string, '"foo.inko", line 1, in "foo"')
}
}
test.group('std::debug.stacktrace') do (g) {
g.test('Obtaining a stacktrace to the caller') {
let trace = debug.stacktrace
......@@ -43,7 +35,7 @@ test.group('std::debug.stacktrace') do (g) {
assert.true(trace.length > 0)
assert.equal(last.name, '<block>')
assert.equal(last.line, 40)
assert.equal(last.line, 32)
assert.equal(last.path, mirror.path)
}
......@@ -69,6 +61,6 @@ test.group('std::debug.last_call_frame_in') do (g) {
assert.equal(frame.name, '<block>')
assert.equal(frame.path, mirror.path)
assert.equal(frame.line, 68)
assert.equal(frame.line, 60)
}
}
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment