kotlinx-io icon indicating copy to clipboard operation
kotlinx-io copied to clipboard

Web crash `get_os().platform() == 'win32'`

Open raspberry-jenshen opened this issue 5 months ago • 2 comments

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';
    }
  }

raspberry-jenshen avatar Sep 23 '24 08:09 raspberry-jenshen