[JS IR] Extract adding of function call to another function
[JS IR] Add option for dce mode [JS IR] Add logging to non useful declarations if appropriate dce mode [JS IR] Add mode with throwing exception [JS IR] unreachableDeclaration method is in rootDeclarations [JS IR] Add js extra help arg with dce mode and include debug.kt to compile unreachableMethod [JS IR] unreachableDeclaration as internal to not reproduce stdlib api [JS IR] Fix description of dce mode argument - Use console.error instead of console.log - Use JsError instead Kotlin exception for lightweight [JS IR] Remove body for throwing exception [JS IR] Remove default parameter in unreachableDeclaration [JS IR] Process without removing fields and declaration containers [JS IR] Rename dce mode on dce runtime diagnostic [JS IR] Use console.trace instead of console.error [JS IR] Extract JsError - Fix naming in prependFunctionCall - Fix description on runtime diagnostic argument - Using message collector instead of throwing exception [JS IR] Distinguish unreachableMethods for log and exception [JS IR] Extract checking of Kotlin packages of IrField ^KT-45059 fixed
This commit is contained in:
@@ -71,7 +71,6 @@ val jsMainSources by task<Sync> {
|
||||
"libraries/stdlib/js/src/kotlin/console.kt",
|
||||
"libraries/stdlib/js/src/kotlin/coreDeprecated.kt",
|
||||
"libraries/stdlib/js/src/kotlin/date.kt",
|
||||
"libraries/stdlib/js/src/kotlin/debug.kt",
|
||||
"libraries/stdlib/js/src/kotlin/grouping.kt",
|
||||
"libraries/stdlib/js/src/kotlin/json.kt",
|
||||
"libraries/stdlib/js/src/kotlin/promise.kt",
|
||||
|
||||
@@ -0,0 +1,7 @@
|
||||
/*
|
||||
* Copyright 2010-2021 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.
|
||||
*/
|
||||
|
||||
@JsName("Error")
|
||||
internal open external class JsError(message: String) : Throwable
|
||||
@@ -0,0 +1,16 @@
|
||||
/*
|
||||
* Copyright 2010-2021 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.js
|
||||
|
||||
import JsError
|
||||
|
||||
internal fun unreachableDeclarationLog() {
|
||||
console.asDynamic().trace("Unreachable declaration")
|
||||
}
|
||||
|
||||
internal fun unreachableDeclarationException() {
|
||||
throw JsError("Unreachable declaration")
|
||||
}
|
||||
Reference in New Issue
Block a user