Skip to content

Commit

Permalink
Wasm. Compat script for JsError (#2449)
Browse files Browse the repository at this point in the history
  • Loading branch information
turansky committed Aug 31, 2024
1 parent 213534c commit 5802748
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions buildSrc/src/main/kotlin/wasm-compat.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -78,10 +78,14 @@ fun applyJsErrorPatch(
content: String,
): String {
if (": Throwable /* JsError */" in content) {
val afterPackage = content
.substringAfter("\npackage ")
.substringAfter("\n")

return content
.replaceFirst(
"\nimport ",
"\nimport js.error.JsError\nimport "
afterPackage,
"import js.error.JsError\n$afterPackage"
)
.replace(
": Throwable /* JsError */",
Expand Down

0 comments on commit 5802748

Please sign in to comment.