[JS IR BE] Simplify throwable lowering.

- Make kotlin.Throwable class extenral
- Add runtime function 'extendThrowable' to use instead of delegating
  constructors to Throwable
This commit is contained in:
Svyatoslav Kuzmich
2019-07-02 17:43:13 +03:00
parent 6d1f893a5a
commit 918d470e1b
12 changed files with 188 additions and 448 deletions
@@ -0,0 +1,23 @@
/*
* Copyright 2010-2019 JetBrains s.r.o. and Kotlin Programming Language contributors.
* Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file.
*/
package kotlin
/**
* The base class for all errors and exceptions. Only instances of this class can be thrown or caught.
*
* @param message the detail message string.
* @param cause the cause of this throwable.
*/
@JsName("Error")
public external open class Throwable {
open val message: String?
open val cause: Throwable?
constructor(message: String?, cause: Throwable?)
constructor(message: String?)
constructor(cause: Throwable?)
constructor()
}