kotlinx-io
kotlinx-io copied to clipboard
Web crash `get_os().platform() == 'win32'`
Hello!
Thank you for your cool package!
I faced issues when I converted my Kotlin code to the web platform (JS).
My code:
internal class FileSystemImpl(
private val fileSystem: KotlinFiles = SystemFileSystem,
) : FileSystem {
The crash:
platform undefined
The crash happens when FileSystemImpl is created.
// JS code
var properties_initialized_FileSystemJs_kt_lg8f5i;
function _init_properties_FileSystemJs_kt__4boaac() {
if (!properties_initialized_FileSystemJs_kt_lg8f5i) {
properties_initialized_FileSystemJs_kt_lg8f5i = true;
SystemFileSystem = new SystemFileSystem$1();
// crash is here
isWindows = get_os().platform() == 'win32';
}
}