KotlinMultiPlatform icon indicating copy to clipboard operation
KotlinMultiPlatform copied to clipboard

JavaScript version of the app can't handle starting arguments

Open danon opened this issue 5 years ago • 0 comments

In the build JS there's

///...
  var package$feature = package$com.feature || (package$com.feature = {});
  package$feature.main_kand9s$ = main;
  package$feature.Platform = Platform;
  main([]);
}));

You can see it calls main([]);

I don't understand why is that, since regardless if you call like like so

node test.js foo bar

or like so

./test.js foo bar

It's argument structure is always the same:

$ ./test.js foo bar
[ '/Users/danon/.nvm/versions/node/v10.17.0/bin/node',
  '/Users/danon/Projects/test.js',
  'foo',
  'bar' ]

Why couldn't kotlin compile it to JS

main(process.argv.slice(2));

JVM compiled version with the same Kotlin code does handle starting arguments.

danon avatar Sep 07 '20 19:09 danon