Update Throwable methods documentation (#3364)

This commit is contained in:
SvyatoslavScherbina
2019-09-20 11:30:20 +03:00
committed by GitHub
parent 41914cc477
commit b37465495a
2 changed files with 12 additions and 1 deletions
+8 -1
View File
@@ -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()