Skip to content

Instantly share code, notes, and snippets.

@nosix
Created September 4, 2017 06:04
Show Gist options
  • Save nosix/c83344c310078b20551250f767e5129b to your computer and use it in GitHub Desktop.
Save nosix/c83344c310078b20551250f767e5129b to your computer and use it in GitHub Desktop.
convert deprecated @nativeGetter/@nativeSetter to inline extension function
external interface MethodMap
inline operator fun MethodMap.get(propertyName: String): Function<Any>? = this.asDynamic()[propertyName]
inline operator fun MethodMap.set(propertyName: String, value: Function<Any>?) {
this.asDynamic()[propertyName] = value
}
external interface MethodMap {
@nativeGetter
operator fun get(propertyName: String): Function<Any>?
@nativeSetter
operator fun set(propertyName: String, value: Function<Any>)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment