Update Throwable methods documentation (#3364)
This commit is contained in:
committed by
GitHub
parent
41914cc477
commit
b37465495a
@@ -32,11 +32,18 @@ public open class Throwable(open val message: String?, open val cause: Throwable
|
||||
getStackTraceStrings(stackTrace).freeze()
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns an array of stack trace strings representing the stack trace
|
||||
* pertaining to this throwable.
|
||||
*/
|
||||
public fun getStackTrace(): Array<String> = stackTraceStrings
|
||||
|
||||
internal fun Throwable.getStackTraceAddressesInternal(): List<Long> =
|
||||
internal fun getStackTraceAddressesInternal(): List<Long> =
|
||||
(0 until stackTrace.size).map { index -> stackTrace[index].toLong() }
|
||||
|
||||
/**
|
||||
* Prints the stack trace of this throwable to the standard output.
|
||||
*/
|
||||
public fun printStackTrace(): Unit = dumpStackTrace { println(it) }
|
||||
|
||||
internal fun dumpStackTrace(): String = buildString {
|
||||
|
||||
@@ -4,5 +4,9 @@
|
||||
*/
|
||||
package kotlin.native
|
||||
|
||||
/**
|
||||
* Returns a list of stack trace addresses representing the stack trace
|
||||
* pertaining to this throwable.
|
||||
*/
|
||||
public fun Throwable.getStackTraceAddresses(): List<Long> =
|
||||
this.getStackTraceAddressesInternal()
|
||||
|
||||
Reference in New Issue
Block a user