https://kotlinlang.org logo
#javascript
Title
# javascript
e

Edoardo Luppi

11/20/2023, 10:44 AM
@turansky just seen a new
JsPrimitive
annotation on wrappers, from Seskar. What does it do?
t

turansky

11/20/2023, 10:53 AM
It's for
Symbol
and
BigInt
. It will correct
is/as
operator calls
Copy code
// Kotlin
a is Symbol

// JS - default
a instanceof Symbol

// JS - with plugin
typeof a === 'symbol'
e

Edoardo Luppi

11/20/2023, 10:55 AM
Sounds good! Thanks
Functional question: I see you wrapped
Copy code
jsTypeOf(o) == type
in your own function
seskar.js.internal.hasType
. Is this because it's easier to implement the compiler transformation? (instead of building the
jsTypeOf(o) == type
expression)
t

turansky

11/20/2023, 11:49 AM
Is this because it's easier to implement the compiler transformation?
Yes
gratitude thank you 1
In any case
hasType
will be inlined