I'm adapting <https://developer.chrome.com/apps/ru...
# javascript
j
I'm adapting https://developer.chrome.com/apps/runtime which has functions that take arguments (
getUrl
), functions which take async callbacks (
getBackgroundPage
), and functions which perform actions (
reload()
). But then it has this
getManifest()
function which takes no arguments, isn't async with a callback, and isn't performing some kind of action. Were I encapsulating this in a class, I would do
val manifest: Json get() = delegate.getManifest()
to expose it as a property. This is an external interface though so I'm forced into
fun getManifest()
s
its not as nice but you can get your property and getter at the same time if you make it an extension property
ie.
val ExternalInterface.manifest : Manifest get() = asDynamic().manifest
j
Yeah I know. I was hoping that something like
val manifest: Json @JvmName("getManifest") get()
would just work
s
Try
val manifest: Json @JsName("getManifest") get
j
ah!!! that indeed works. I naively was using the parenthesis on
get()
since you have to do that with functions 🤦‍♂️
thanks!