-
Notifications
You must be signed in to change notification settings - Fork 5.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[JS IR] Invalidate an incremental cache in case of errors
Errors may corrupt the incremental cache file, which may affect the subsequent build and generate broken JS code. The patch invalidates cache directories in case of the error, so prevents the cache corruption. ^KT-56282 Fixed
- Loading branch information
1 parent
08dd52f
commit b6cde89
Showing
7 changed files
with
77 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
15 changes: 15 additions & 0 deletions
15
...s/src/test/resources/testProject/kotlin-js-ir-ic-rebuild-after-error/app/build.gradle.kts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
plugins { | ||
kotlin("js") | ||
} | ||
|
||
kotlin { | ||
js { | ||
browser { | ||
} | ||
binaries.executable() | ||
} | ||
} | ||
|
||
configurations["compileClasspath"].apply { | ||
attributes.attribute(Usage.USAGE_ATTRIBUTE, objects.named(Usage::class.java, "kotlin-runtime")) | ||
} |
17 changes: 17 additions & 0 deletions
17
...test/resources/testProject/kotlin-js-ir-ic-rebuild-after-error/app/src/main/kotlin/App.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
/* | ||
* Copyright 2010-2023 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 com.example | ||
|
||
private fun someFunction(x: Any? = null) {} | ||
|
||
fun getSomething(x: dynamic) = with(x) { | ||
someFunction(::unkownFunction) | ||
"Hello!" | ||
} | ||
|
||
fun main() { | ||
println(getSomething(null)) | ||
} |
13 changes: 13 additions & 0 deletions
13
...tests/src/test/resources/testProject/kotlin-js-ir-ic-rebuild-after-error/build.gradle.kts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
plugins { | ||
kotlin("js").apply(false) | ||
} | ||
|
||
group = "com.example" | ||
version = "1.0" | ||
|
||
allprojects { | ||
repositories { | ||
mavenLocal() | ||
mavenCentral() | ||
} | ||
} |
2 changes: 2 additions & 0 deletions
2
...ests/src/test/resources/testProject/kotlin-js-ir-ic-rebuild-after-error/gradle.properties
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
kotlin.incremental.js.klib=true | ||
kotlin.incremental.js.ir=true |
3 changes: 3 additions & 0 deletions
3
...-tests/src/test/resources/testProject/kotlin-js-ir-ic-rebuild-after-error/settings.gradle
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
rootProject.name = "kotlin-js-ir-ic-rebuild-after-error" | ||
|
||
include("app") |