From what I am understanding this PR is able to lower Kotlin class into JS ES6 class.
I think the webpack configuration used by the kotlin compiler is set to ES5, that’s why the spread operator is unrecognized. If they support ES6 classes, they will probably update said webpack config to ES6, thus supporting spread operator.
Again, this is pure speculation, If someone at jetbrains can enlighten us, it would be great
In code passed to js function you can’t use features introduced after EcmaScript 5. So, you can’t use spread operator there since it was introduced in ES6 (aka ES2015).
Honestly, we don’t recommend to use js function unless you need to do some low-level stuff (for something impossible to implement in pure Kotlin, more rarely for a performance reason).