[JS IR] Revert removing of safeProperty(Get|Set)
This commit is contained in:
@@ -13,6 +13,18 @@ internal fun <T : Enum<T>> enumValuesIntrinsic(): Array<T> =
|
|||||||
internal fun <T : Enum<T>> enumValueOfIntrinsic(@Suppress("UNUSED_PARAMETER") name: String): T =
|
internal fun <T : Enum<T>> enumValueOfIntrinsic(@Suppress("UNUSED_PARAMETER") name: String): T =
|
||||||
throw IllegalStateException("Should be replaced by compiler")
|
throw IllegalStateException("Should be replaced by compiler")
|
||||||
|
|
||||||
|
@PublishedApi
|
||||||
|
internal fun safePropertyGet(self: dynamic, getterName: String, propName: String): dynamic {
|
||||||
|
val getter = self[getterName]
|
||||||
|
return if (getter != null) getter.call(self) else self[propName]
|
||||||
|
}
|
||||||
|
|
||||||
|
@PublishedApi
|
||||||
|
internal fun safePropertySet(self: dynamic, setterName: String, propName: String, value: dynamic) {
|
||||||
|
val setter = self[setterName]
|
||||||
|
if (setter != null) setter.call(self, value) else self[propName] = value
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Implements annotated function in JavaScript.
|
* Implements annotated function in JavaScript.
|
||||||
* [code] string must contain JS expression that evaluates to JS function with signature that matches annotated kotlin function
|
* [code] string must contain JS expression that evaluates to JS function with signature that matches annotated kotlin function
|
||||||
|
|||||||
Reference in New Issue
Block a user