Skip to content

Commit 8d2bb75

Browse files
committed
Fixed metadata compilation failure
1 parent d810e28 commit 8d2bb75

File tree

6 files changed

+26
-6
lines changed

6 files changed

+26
-6
lines changed

core/js/src/node/initializers.kt

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
/*
2+
* Copyright 2010-2024 JetBrains s.r.o. and Kotlin Programming Language contributors.
3+
* Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE.txt file.
4+
*/
5+
6+
package kotlinx.io.node
7+
8+
internal actual fun bufferInitializer(): BufferModule? = js("eval('require')('buffer')")
9+
internal actual fun osInitializer(): Os? = js("eval('require')('os')")
10+
internal actual fun fsInitializer(): Fs? = js("eval('require')('fs')")
11+
internal actual fun pathInitializer(): Path? = js("eval('require')('path')")

core/nodeFilesystemShared/src/node/buffer.kt

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,6 @@
55

66
package kotlinx.io.node
77

8-
import kotlinx.io.withCaughtException
9-
108
internal external interface BufferModule {
119
val Buffer: BufferObj
1210
}
@@ -28,4 +26,4 @@ internal val buffer: BufferModule by lazy {
2826
loadModule("buffer", ::bufferInitializer)
2927
}
3028

31-
private fun bufferInitializer(): BufferModule? = js("eval('require')('buffer')")
29+
internal expect fun bufferInitializer(): BufferModule?

core/nodeFilesystemShared/src/node/fs.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,4 +90,4 @@ internal val fs: Fs by lazy {
9090
loadModule("fs", ::fsInitializer)
9191
}
9292

93-
private fun fsInitializer(): Fs? = js("eval('require')('fs')")
93+
internal expect fun fsInitializer(): Fs?

core/nodeFilesystemShared/src/node/os.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,4 +22,4 @@ internal val os: Os by lazy {
2222
loadModule("os", ::osInitializer)
2323
}
2424

25-
private fun osInitializer(): Os? = js("eval('require')('os')")
25+
internal expect fun osInitializer(): Os?

core/nodeFilesystemShared/src/node/path.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,4 +18,4 @@ internal val path: Path by lazy {
1818
loadModule("path", ::pathInitializer)
1919
}
2020

21-
private fun pathInitializer(): Path? = js("eval('require')('path')")
21+
internal expect fun pathInitializer(): Path?

core/wasmJs/src/node/initializers.kt

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
/*
2+
* Copyright 2010-2024 JetBrains s.r.o. and Kotlin Programming Language contributors.
3+
* Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE.txt file.
4+
*/
5+
6+
package kotlinx.io.node
7+
8+
internal actual fun bufferInitializer(): BufferModule? = js("eval('require')('buffer')")
9+
internal actual fun osInitializer(): Os? = js("eval('require')('os')")
10+
internal actual fun fsInitializer(): Fs? = js("eval('require')('fs')")
11+
internal actual fun pathInitializer(): Path? = js("eval('require')('path')")

0 commit comments

Comments
 (0)