KotlinMultiPlatform
KotlinMultiPlatform copied to clipboard
JavaScript version of the app can't handle starting arguments
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.