Is there an issue that describes the reasoning beh...
# javascript
e
Is there an issue that describes the reasoning behind
-Xenable-extension-functions-in-externals
(and maybe why it's off by default)?
a
I don't know about any.
e
Found https://github.com/JetBrains/kotlin/commit/83c1a119eeadbe431f925b1fcbb5af1fb0c90391 But yeah did not get how it came up, maybe @Ilya Goncharov [JB] remembers
i
There was a demand from one of JetBrains project. The reason is that it can be ambiguity what we understand with “extension functions in externals”, because of dynamic nature of
this
in JavaScript. That’s why it is not default There can be 2 different cases 1. It is indeed replacement of
this
, for example you have class A in js, and function
foo
, but
this
in the function is not
A
but something different 2. Just like on JVM it is another argument in a method. So compiler key enables exactly this option.
e
Thank you! Just tried it and it can be useful indeed