JS: fix class literal expression with primitive classes. See KT-16545
This commit is contained in:
@@ -64,6 +64,12 @@ Kotlin.Long = function(low, high) {
|
||||
this.high_ = high | 0; // force into 32 signed bits.
|
||||
};
|
||||
|
||||
Kotlin.Long.$metadata$ = {
|
||||
kind: "class",
|
||||
simpleName: "Long",
|
||||
interfaces:[]
|
||||
};
|
||||
|
||||
|
||||
// NOTE: Common constant values ZERO, ONE, NEG_ONE, etc. are defined below the
|
||||
// from* methods on which they depend.
|
||||
|
||||
@@ -35,7 +35,12 @@ external fun <T : Any> jsClass(): JsClass<T>
|
||||
|
||||
@Deprecated("Use class literal and extension property `js` instead.", replaceWith = ReplaceWith("this::class.js"), level = DeprecationLevel.WARNING)
|
||||
val <T : Any> T.jsClass: JsClass<T>
|
||||
get() = js("Object").getPrototypeOf(this).constructor
|
||||
get() = when (jsTypeOf(this)) {
|
||||
"string" -> js("String")
|
||||
"number" -> js("Number")
|
||||
"boolean" -> js("Boolean")
|
||||
else -> js("Object").getPrototypeOf(this).constructor
|
||||
}
|
||||
|
||||
/**
|
||||
* Obtains a constructor reference for the given `KClass`.
|
||||
|
||||
Reference in New Issue
Block a user