From 46a669507211e97dc298d92e2bee75e51071a93a Mon Sep 17 00:00:00 2001 From: Svyatoslav Kuzmich Date: Tue, 21 Mar 2023 12:11:29 +0100 Subject: [PATCH] [Wasm] WebIDL: Make getters and setters not inline --- .../wasm/src/org.w3c/org.khronos.webgl.kt | 72 +++------- .../wasm/src/org.w3c/org.w3c.dom.css.kt | 16 +-- .../stdlib/wasm/src/org.w3c/org.w3c.dom.kt | 128 +++++------------- .../src/org.w3c/org.w3c.dom.mediasource.kt | 4 +- .../wasm/src/org.w3c/org.w3c.dom.svg.kt | 48 ++----- .../stdlib/wasm/src/org.w3c/org.w3c.files.kt | 4 +- .../kotlin/tools/dukat/wasm/convertToModel.kt | 12 +- 7 files changed, 72 insertions(+), 212 deletions(-) diff --git a/libraries/stdlib/wasm/src/org.w3c/org.khronos.webgl.kt b/libraries/stdlib/wasm/src/org.w3c/org.khronos.webgl.kt index ace163d7fe1..664a0e86364 100644 --- a/libraries/stdlib/wasm/src/org.w3c/org.khronos.webgl.kt +++ b/libraries/stdlib/wasm/src/org.w3c/org.khronos.webgl.kt @@ -924,19 +924,15 @@ public external open class Int8Array : ArrayBufferView, JsAny { } } -@PublishedApi @Suppress("UNUSED_PARAMETER") internal fun getMethodImplForInt8Array(obj: Int8Array, index: Int): Byte { js("return obj[index];") } -@kotlin.internal.InlineOnly -public inline operator fun Int8Array.get(index: Int): Byte = getMethodImplForInt8Array(this, index) +public operator fun Int8Array.get(index: Int): Byte = getMethodImplForInt8Array(this, index) -@PublishedApi @Suppress("UNUSED_PARAMETER") internal fun setMethodImplForInt8Array(obj: Int8Array, index: Int, value: Byte) { js("obj[index] = value;") } -@kotlin.internal.InlineOnly -public inline operator fun Int8Array.set(index: Int, value: Byte) = setMethodImplForInt8Array(this, index, value) +public operator fun Int8Array.set(index: Int, value: Byte) = setMethodImplForInt8Array(this, index, value) /** * Exposes the JavaScript [Uint8Array](https://developer.mozilla.org/en/docs/Web/API/Uint8Array) to Kotlin @@ -959,19 +955,15 @@ public external open class Uint8Array : ArrayBufferView, JsAny { } } -@PublishedApi @Suppress("UNUSED_PARAMETER") internal fun getMethodImplForUint8Array(obj: Uint8Array, index: Int): Byte { js("return obj[index];") } -@kotlin.internal.InlineOnly -public inline operator fun Uint8Array.get(index: Int): Byte = getMethodImplForUint8Array(this, index) +public operator fun Uint8Array.get(index: Int): Byte = getMethodImplForUint8Array(this, index) -@PublishedApi @Suppress("UNUSED_PARAMETER") internal fun setMethodImplForUint8Array(obj: Uint8Array, index: Int, value: Byte) { js("obj[index] = value;") } -@kotlin.internal.InlineOnly -public inline operator fun Uint8Array.set(index: Int, value: Byte) = setMethodImplForUint8Array(this, index, value) +public operator fun Uint8Array.set(index: Int, value: Byte) = setMethodImplForUint8Array(this, index, value) /** * Exposes the JavaScript [Uint8ClampedArray](https://developer.mozilla.org/en/docs/Web/API/Uint8ClampedArray) to Kotlin @@ -994,19 +986,15 @@ public external open class Uint8ClampedArray : ArrayBufferView, JsAny { } } -@PublishedApi @Suppress("UNUSED_PARAMETER") internal fun getMethodImplForUint8ClampedArray(obj: Uint8ClampedArray, index: Int): Byte { js("return obj[index];") } -@kotlin.internal.InlineOnly -public inline operator fun Uint8ClampedArray.get(index: Int): Byte = getMethodImplForUint8ClampedArray(this, index) +public operator fun Uint8ClampedArray.get(index: Int): Byte = getMethodImplForUint8ClampedArray(this, index) -@PublishedApi @Suppress("UNUSED_PARAMETER") internal fun setMethodImplForUint8ClampedArray(obj: Uint8ClampedArray, index: Int, value: Byte) { js("obj[index] = value;") } -@kotlin.internal.InlineOnly -public inline operator fun Uint8ClampedArray.set(index: Int, value: Byte) = setMethodImplForUint8ClampedArray(this, index, value) +public operator fun Uint8ClampedArray.set(index: Int, value: Byte) = setMethodImplForUint8ClampedArray(this, index, value) /** * Exposes the JavaScript [Int16Array](https://developer.mozilla.org/en/docs/Web/API/Int16Array) to Kotlin @@ -1029,19 +1017,15 @@ public external open class Int16Array : ArrayBufferView, JsAny { } } -@PublishedApi @Suppress("UNUSED_PARAMETER") internal fun getMethodImplForInt16Array(obj: Int16Array, index: Int): Short { js("return obj[index];") } -@kotlin.internal.InlineOnly -public inline operator fun Int16Array.get(index: Int): Short = getMethodImplForInt16Array(this, index) +public operator fun Int16Array.get(index: Int): Short = getMethodImplForInt16Array(this, index) -@PublishedApi @Suppress("UNUSED_PARAMETER") internal fun setMethodImplForInt16Array(obj: Int16Array, index: Int, value: Short) { js("obj[index] = value;") } -@kotlin.internal.InlineOnly -public inline operator fun Int16Array.set(index: Int, value: Short) = setMethodImplForInt16Array(this, index, value) +public operator fun Int16Array.set(index: Int, value: Short) = setMethodImplForInt16Array(this, index, value) /** * Exposes the JavaScript [Uint16Array](https://developer.mozilla.org/en/docs/Web/API/Uint16Array) to Kotlin @@ -1064,19 +1048,15 @@ public external open class Uint16Array : ArrayBufferView, JsAny { } } -@PublishedApi @Suppress("UNUSED_PARAMETER") internal fun getMethodImplForUint16Array(obj: Uint16Array, index: Int): Short { js("return obj[index];") } -@kotlin.internal.InlineOnly -public inline operator fun Uint16Array.get(index: Int): Short = getMethodImplForUint16Array(this, index) +public operator fun Uint16Array.get(index: Int): Short = getMethodImplForUint16Array(this, index) -@PublishedApi @Suppress("UNUSED_PARAMETER") internal fun setMethodImplForUint16Array(obj: Uint16Array, index: Int, value: Short) { js("obj[index] = value;") } -@kotlin.internal.InlineOnly -public inline operator fun Uint16Array.set(index: Int, value: Short) = setMethodImplForUint16Array(this, index, value) +public operator fun Uint16Array.set(index: Int, value: Short) = setMethodImplForUint16Array(this, index, value) /** * Exposes the JavaScript [Int32Array](https://developer.mozilla.org/en/docs/Web/API/Int32Array) to Kotlin @@ -1099,19 +1079,15 @@ public external open class Int32Array : ArrayBufferView, JsAny { } } -@PublishedApi @Suppress("UNUSED_PARAMETER") internal fun getMethodImplForInt32Array(obj: Int32Array, index: Int): Int { js("return obj[index];") } -@kotlin.internal.InlineOnly -public inline operator fun Int32Array.get(index: Int): Int = getMethodImplForInt32Array(this, index) +public operator fun Int32Array.get(index: Int): Int = getMethodImplForInt32Array(this, index) -@PublishedApi @Suppress("UNUSED_PARAMETER") internal fun setMethodImplForInt32Array(obj: Int32Array, index: Int, value: Int) { js("obj[index] = value;") } -@kotlin.internal.InlineOnly -public inline operator fun Int32Array.set(index: Int, value: Int) = setMethodImplForInt32Array(this, index, value) +public operator fun Int32Array.set(index: Int, value: Int) = setMethodImplForInt32Array(this, index, value) /** * Exposes the JavaScript [Uint32Array](https://developer.mozilla.org/en/docs/Web/API/Uint32Array) to Kotlin @@ -1134,19 +1110,15 @@ public external open class Uint32Array : ArrayBufferView, JsAny { } } -@PublishedApi @Suppress("UNUSED_PARAMETER") internal fun getMethodImplForUint32Array(obj: Uint32Array, index: Int): Int { js("return obj[index];") } -@kotlin.internal.InlineOnly -public inline operator fun Uint32Array.get(index: Int): Int = getMethodImplForUint32Array(this, index) +public operator fun Uint32Array.get(index: Int): Int = getMethodImplForUint32Array(this, index) -@PublishedApi @Suppress("UNUSED_PARAMETER") internal fun setMethodImplForUint32Array(obj: Uint32Array, index: Int, value: Int) { js("obj[index] = value;") } -@kotlin.internal.InlineOnly -public inline operator fun Uint32Array.set(index: Int, value: Int) = setMethodImplForUint32Array(this, index, value) +public operator fun Uint32Array.set(index: Int, value: Int) = setMethodImplForUint32Array(this, index, value) /** * Exposes the JavaScript [Float32Array](https://developer.mozilla.org/en/docs/Web/API/Float32Array) to Kotlin @@ -1169,19 +1141,15 @@ public external open class Float32Array : ArrayBufferView, JsAny { } } -@PublishedApi @Suppress("UNUSED_PARAMETER") internal fun getMethodImplForFloat32Array(obj: Float32Array, index: Int): Float { js("return obj[index];") } -@kotlin.internal.InlineOnly -public inline operator fun Float32Array.get(index: Int): Float = getMethodImplForFloat32Array(this, index) +public operator fun Float32Array.get(index: Int): Float = getMethodImplForFloat32Array(this, index) -@PublishedApi @Suppress("UNUSED_PARAMETER") internal fun setMethodImplForFloat32Array(obj: Float32Array, index: Int, value: Float) { js("obj[index] = value;") } -@kotlin.internal.InlineOnly -public inline operator fun Float32Array.set(index: Int, value: Float) = setMethodImplForFloat32Array(this, index, value) +public operator fun Float32Array.set(index: Int, value: Float) = setMethodImplForFloat32Array(this, index, value) /** * Exposes the JavaScript [Float64Array](https://developer.mozilla.org/en/docs/Web/API/Float64Array) to Kotlin @@ -1204,19 +1172,15 @@ public external open class Float64Array : ArrayBufferView, JsAny { } } -@PublishedApi @Suppress("UNUSED_PARAMETER") internal fun getMethodImplForFloat64Array(obj: Float64Array, index: Int): Double { js("return obj[index];") } -@kotlin.internal.InlineOnly -public inline operator fun Float64Array.get(index: Int): Double = getMethodImplForFloat64Array(this, index) +public operator fun Float64Array.get(index: Int): Double = getMethodImplForFloat64Array(this, index) -@PublishedApi @Suppress("UNUSED_PARAMETER") internal fun setMethodImplForFloat64Array(obj: Float64Array, index: Int, value: Double) { js("obj[index] = value;") } -@kotlin.internal.InlineOnly -public inline operator fun Float64Array.set(index: Int, value: Double) = setMethodImplForFloat64Array(this, index, value) +public operator fun Float64Array.set(index: Int, value: Double) = setMethodImplForFloat64Array(this, index, value) /** * Exposes the JavaScript [DataView](https://developer.mozilla.org/en/docs/Web/API/DataView) to Kotlin diff --git a/libraries/stdlib/wasm/src/org.w3c/org.w3c.dom.css.kt b/libraries/stdlib/wasm/src/org.w3c/org.w3c.dom.css.kt index 89cdfa26da5..be78cc7edd8 100644 --- a/libraries/stdlib/wasm/src/org.w3c/org.w3c.dom.css.kt +++ b/libraries/stdlib/wasm/src/org.w3c/org.w3c.dom.css.kt @@ -19,12 +19,10 @@ public external abstract class MediaList : ItemArrayLike, JsAny { override fun item(index: Int): JsString? } -@PublishedApi @Suppress("UNUSED_PARAMETER") internal fun getMethodImplForMediaList(obj: MediaList, index: Int): String? { js("return obj[index];") } -@kotlin.internal.InlineOnly -public inline operator fun MediaList.get(index: Int): String? = getMethodImplForMediaList(this, index) +public operator fun MediaList.get(index: Int): String? = getMethodImplForMediaList(this, index) /** * Exposes the JavaScript [StyleSheet](https://developer.mozilla.org/en/docs/Web/API/StyleSheet) to Kotlin @@ -56,12 +54,10 @@ public external abstract class StyleSheetList : ItemArrayLike, JsAny override fun item(index: Int): StyleSheet? } -@PublishedApi @Suppress("UNUSED_PARAMETER") internal fun getMethodImplForStyleSheetList(obj: StyleSheetList, index: Int): StyleSheet? { js("return obj[index];") } -@kotlin.internal.InlineOnly -public inline operator fun StyleSheetList.get(index: Int): StyleSheet? = getMethodImplForStyleSheetList(this, index) +public operator fun StyleSheetList.get(index: Int): StyleSheet? = getMethodImplForStyleSheetList(this, index) /** * Exposes the JavaScript [LinkStyle](https://developer.mozilla.org/en/docs/Web/API/LinkStyle) to Kotlin @@ -78,12 +74,10 @@ public external abstract class CSSRuleList : ItemArrayLike, JsAny { override fun item(index: Int): CSSRule? } -@PublishedApi @Suppress("UNUSED_PARAMETER") internal fun getMethodImplForCSSRuleList(obj: CSSRuleList, index: Int): CSSRule? { js("return obj[index];") } -@kotlin.internal.InlineOnly -public inline operator fun CSSRuleList.get(index: Int): CSSRule? = getMethodImplForCSSRuleList(this, index) +public operator fun CSSRuleList.get(index: Int): CSSRule? = getMethodImplForCSSRuleList(this, index) /** * Exposes the JavaScript [CSSRule](https://developer.mozilla.org/en/docs/Web/API/CSSRule) to Kotlin @@ -476,12 +470,10 @@ public external abstract class CSSStyleDeclaration : ItemArrayLike, Js override fun item(index: Int): JsString } -@PublishedApi @Suppress("UNUSED_PARAMETER") internal fun getMethodImplForCSSStyleDeclaration(obj: CSSStyleDeclaration, index: Int): String? { js("return obj[index];") } -@kotlin.internal.InlineOnly -public inline operator fun CSSStyleDeclaration.get(index: Int): String? = getMethodImplForCSSStyleDeclaration(this, index) +public operator fun CSSStyleDeclaration.get(index: Int): String? = getMethodImplForCSSStyleDeclaration(this, index) public external interface ElementCSSInlineStyle : JsAny { val style: CSSStyleDeclaration diff --git a/libraries/stdlib/wasm/src/org.w3c/org.w3c.dom.kt b/libraries/stdlib/wasm/src/org.w3c/org.w3c.dom.kt index 545c4117178..55542d66802 100644 --- a/libraries/stdlib/wasm/src/org.w3c/org.w3c.dom.kt +++ b/libraries/stdlib/wasm/src/org.w3c/org.w3c.dom.kt @@ -30,19 +30,15 @@ public external abstract class HTMLAllCollection : JsAny { fun namedItem(name: String): UnionElementOrHTMLCollection? } -@PublishedApi @Suppress("UNUSED_PARAMETER") internal fun getMethodImplForHTMLAllCollection(obj: HTMLAllCollection, index: Int): Element? { js("return obj[index];") } -@kotlin.internal.InlineOnly -public inline operator fun HTMLAllCollection.get(index: Int): Element? = getMethodImplForHTMLAllCollection(this, index) +public operator fun HTMLAllCollection.get(index: Int): Element? = getMethodImplForHTMLAllCollection(this, index) -@PublishedApi @Suppress("UNUSED_PARAMETER") internal fun getMethodImplForHTMLAllCollection(obj: HTMLAllCollection, name: String): UnionElementOrHTMLCollection? { js("return obj[name];") } -@kotlin.internal.InlineOnly -public inline operator fun HTMLAllCollection.get(name: String): UnionElementOrHTMLCollection? = getMethodImplForHTMLAllCollection(this, name) +public operator fun HTMLAllCollection.get(name: String): UnionElementOrHTMLCollection? = getMethodImplForHTMLAllCollection(this, name) /** * Exposes the JavaScript [HTMLFormControlsCollection](https://developer.mozilla.org/en/docs/Web/API/HTMLFormControlsCollection) to Kotlin @@ -66,12 +62,10 @@ public external abstract class HTMLOptionsCollection : HTMLCollection, JsAny { fun remove(index: Int) } -@PublishedApi @Suppress("UNUSED_PARAMETER") internal fun setMethodImplForHTMLOptionsCollection(obj: HTMLOptionsCollection, index: Int, option: HTMLOptionElement?) { js("obj[index] = option;") } -@kotlin.internal.InlineOnly -public inline operator fun HTMLOptionsCollection.set(index: Int, option: HTMLOptionElement?) = setMethodImplForHTMLOptionsCollection(this, index, option) +public operator fun HTMLOptionsCollection.set(index: Int, option: HTMLOptionElement?) = setMethodImplForHTMLOptionsCollection(this, index, option) /** * Exposes the JavaScript [HTMLElement](https://developer.mozilla.org/en/docs/Web/API/HTMLElement) to Kotlin @@ -154,19 +148,15 @@ public external abstract class HTMLUnknownElement : HTMLElement, JsAny { */ public external abstract class DOMStringMap : JsAny -@PublishedApi @Suppress("UNUSED_PARAMETER") internal fun getMethodImplForDOMStringMap(obj: DOMStringMap, name: String): String? { js("return obj[name];") } -@kotlin.internal.InlineOnly -public inline operator fun DOMStringMap.get(name: String): String? = getMethodImplForDOMStringMap(this, name) +public operator fun DOMStringMap.get(name: String): String? = getMethodImplForDOMStringMap(this, name) -@PublishedApi @Suppress("UNUSED_PARAMETER") internal fun setMethodImplForDOMStringMap(obj: DOMStringMap, name: String, value: String) { js("obj[name] = value;") } -@kotlin.internal.InlineOnly -public inline operator fun DOMStringMap.set(name: String, value: String) = setMethodImplForDOMStringMap(this, name, value) +public operator fun DOMStringMap.set(name: String, value: String) = setMethodImplForDOMStringMap(this, name, value) /** * Exposes the JavaScript [HTMLHtmlElement](https://developer.mozilla.org/en/docs/Web/API/HTMLHtmlElement) to Kotlin @@ -1388,12 +1378,10 @@ public external abstract class AudioTrackList : EventTarget, JsAny { fun getTrackById(id: String): AudioTrack? } -@PublishedApi @Suppress("UNUSED_PARAMETER") internal fun getMethodImplForAudioTrackList(obj: AudioTrackList, index: Int): AudioTrack? { js("return obj[index];") } -@kotlin.internal.InlineOnly -public inline operator fun AudioTrackList.get(index: Int): AudioTrack? = getMethodImplForAudioTrackList(this, index) +public operator fun AudioTrackList.get(index: Int): AudioTrack? = getMethodImplForAudioTrackList(this, index) /** * Exposes the JavaScript [AudioTrack](https://developer.mozilla.org/en/docs/Web/API/AudioTrack) to Kotlin @@ -1419,12 +1407,10 @@ public external abstract class VideoTrackList : EventTarget, JsAny { fun getTrackById(id: String): VideoTrack? } -@PublishedApi @Suppress("UNUSED_PARAMETER") internal fun getMethodImplForVideoTrackList(obj: VideoTrackList, index: Int): VideoTrack? { js("return obj[index];") } -@kotlin.internal.InlineOnly -public inline operator fun VideoTrackList.get(index: Int): VideoTrack? = getMethodImplForVideoTrackList(this, index) +public operator fun VideoTrackList.get(index: Int): VideoTrack? = getMethodImplForVideoTrackList(this, index) /** * Exposes the JavaScript [VideoTrack](https://developer.mozilla.org/en/docs/Web/API/VideoTrack) to Kotlin @@ -1446,12 +1432,10 @@ public external abstract class TextTrackList : EventTarget, JsAny { fun getTrackById(id: String): TextTrack? } -@PublishedApi @Suppress("UNUSED_PARAMETER") internal fun getMethodImplForTextTrackList(obj: TextTrackList, index: Int): TextTrack? { js("return obj[index];") } -@kotlin.internal.InlineOnly -public inline operator fun TextTrackList.get(index: Int): TextTrack? = getMethodImplForTextTrackList(this, index) +public operator fun TextTrackList.get(index: Int): TextTrack? = getMethodImplForTextTrackList(this, index) /** * Exposes the JavaScript [TextTrack](https://developer.mozilla.org/en/docs/Web/API/TextTrack) to Kotlin @@ -1476,12 +1460,10 @@ public external abstract class TextTrackCueList : JsAny { fun getCueById(id: String): TextTrackCue? } -@PublishedApi @Suppress("UNUSED_PARAMETER") internal fun getMethodImplForTextTrackCueList(obj: TextTrackCueList, index: Int): TextTrackCue? { js("return obj[index];") } -@kotlin.internal.InlineOnly -public inline operator fun TextTrackCueList.get(index: Int): TextTrackCue? = getMethodImplForTextTrackCueList(this, index) +public operator fun TextTrackCueList.get(index: Int): TextTrackCue? = getMethodImplForTextTrackCueList(this, index) /** * Exposes the JavaScript [TextTrackCue](https://developer.mozilla.org/en/docs/Web/API/TextTrackCue) to Kotlin @@ -1860,19 +1842,15 @@ public external abstract class HTMLFormElement : HTMLElement, JsAny { } } -@PublishedApi @Suppress("UNUSED_PARAMETER") internal fun getMethodImplForHTMLFormElement(obj: HTMLFormElement, index: Int): Element? { js("return obj[index];") } -@kotlin.internal.InlineOnly -public inline operator fun HTMLFormElement.get(index: Int): Element? = getMethodImplForHTMLFormElement(this, index) +public operator fun HTMLFormElement.get(index: Int): Element? = getMethodImplForHTMLFormElement(this, index) -@PublishedApi @Suppress("UNUSED_PARAMETER") internal fun getMethodImplForHTMLFormElement(obj: HTMLFormElement, name: String): UnionElementOrRadioNodeList? { js("return obj[name];") } -@kotlin.internal.InlineOnly -public inline operator fun HTMLFormElement.get(name: String): UnionElementOrRadioNodeList? = getMethodImplForHTMLFormElement(this, name) +public operator fun HTMLFormElement.get(name: String): UnionElementOrRadioNodeList? = getMethodImplForHTMLFormElement(this, name) /** * Exposes the JavaScript [HTMLLabelElement](https://developer.mozilla.org/en/docs/Web/API/HTMLLabelElement) to Kotlin @@ -2085,19 +2063,15 @@ public external abstract class HTMLSelectElement : HTMLElement, ItemArrayLike, JsAny { fun namedItem(name: String): Plugin? } -@PublishedApi @Suppress("UNUSED_PARAMETER") internal fun getMethodImplForPluginArray(obj: PluginArray, index: Int): Plugin? { js("return obj[index];") } -@kotlin.internal.InlineOnly -public inline operator fun PluginArray.get(index: Int): Plugin? = getMethodImplForPluginArray(this, index) +public operator fun PluginArray.get(index: Int): Plugin? = getMethodImplForPluginArray(this, index) -@PublishedApi @Suppress("UNUSED_PARAMETER") internal fun getMethodImplForPluginArray(obj: PluginArray, name: String): Plugin? { js("return obj[name];") } -@kotlin.internal.InlineOnly -public inline operator fun PluginArray.get(name: String): Plugin? = getMethodImplForPluginArray(this, name) +public operator fun PluginArray.get(name: String): Plugin? = getMethodImplForPluginArray(this, name) /** * Exposes the JavaScript [MimeTypeArray](https://developer.mozilla.org/en/docs/Web/API/MimeTypeArray) to Kotlin @@ -3783,19 +3749,15 @@ public external abstract class MimeTypeArray : ItemArrayLike, JsAny { fun namedItem(name: String): MimeType? } -@PublishedApi @Suppress("UNUSED_PARAMETER") internal fun getMethodImplForMimeTypeArray(obj: MimeTypeArray, index: Int): MimeType? { js("return obj[index];") } -@kotlin.internal.InlineOnly -public inline operator fun MimeTypeArray.get(index: Int): MimeType? = getMethodImplForMimeTypeArray(this, index) +public operator fun MimeTypeArray.get(index: Int): MimeType? = getMethodImplForMimeTypeArray(this, index) -@PublishedApi @Suppress("UNUSED_PARAMETER") internal fun getMethodImplForMimeTypeArray(obj: MimeTypeArray, name: String): MimeType? { js("return obj[name];") } -@kotlin.internal.InlineOnly -public inline operator fun MimeTypeArray.get(name: String): MimeType? = getMethodImplForMimeTypeArray(this, name) +public operator fun MimeTypeArray.get(name: String): MimeType? = getMethodImplForMimeTypeArray(this, name) /** * Exposes the JavaScript [Plugin](https://developer.mozilla.org/en/docs/Web/API/Plugin) to Kotlin @@ -3808,19 +3770,15 @@ public external abstract class Plugin : ItemArrayLike, JsAny { fun namedItem(name: String): MimeType? } -@PublishedApi @Suppress("UNUSED_PARAMETER") internal fun getMethodImplForPlugin(obj: Plugin, index: Int): MimeType? { js("return obj[index];") } -@kotlin.internal.InlineOnly -public inline operator fun Plugin.get(index: Int): MimeType? = getMethodImplForPlugin(this, index) +public operator fun Plugin.get(index: Int): MimeType? = getMethodImplForPlugin(this, index) -@PublishedApi @Suppress("UNUSED_PARAMETER") internal fun getMethodImplForPlugin(obj: Plugin, name: String): MimeType? { js("return obj[name];") } -@kotlin.internal.InlineOnly -public inline operator fun Plugin.get(name: String): MimeType? = getMethodImplForPlugin(this, name) +public operator fun Plugin.get(name: String): MimeType? = getMethodImplForPlugin(this, name) /** * Exposes the JavaScript [MimeType](https://developer.mozilla.org/en/docs/Web/API/MimeType) to Kotlin @@ -4135,19 +4093,15 @@ public external abstract class Storage : JsAny { fun setItem(key: String, value: String) } -@PublishedApi @Suppress("UNUSED_PARAMETER") internal fun getMethodImplForStorage(obj: Storage, key: String): String? { js("return obj[key];") } -@kotlin.internal.InlineOnly -public inline operator fun Storage.get(key: String): String? = getMethodImplForStorage(this, key) +public operator fun Storage.get(key: String): String? = getMethodImplForStorage(this, key) -@PublishedApi @Suppress("UNUSED_PARAMETER") internal fun setMethodImplForStorage(obj: Storage, key: String, value: String) { js("obj[key] = value;") } -@kotlin.internal.InlineOnly -public inline operator fun Storage.set(key: String, value: String) = setMethodImplForStorage(this, key, value) +public operator fun Storage.set(key: String, value: String) = setMethodImplForStorage(this, key, value) /** * Exposes the JavaScript [WindowSessionStorage](https://developer.mozilla.org/en/docs/Web/API/WindowSessionStorage) to Kotlin @@ -4526,12 +4480,10 @@ public external abstract class NodeList : ItemArrayLike, JsAny { override fun item(index: Int): Node? } -@PublishedApi @Suppress("UNUSED_PARAMETER") internal fun getMethodImplForNodeList(obj: NodeList, index: Int): Node? { js("return obj[index];") } -@kotlin.internal.InlineOnly -public inline operator fun NodeList.get(index: Int): Node? = getMethodImplForNodeList(this, index) +public operator fun NodeList.get(index: Int): Node? = getMethodImplForNodeList(this, index) /** * Exposes the JavaScript [HTMLCollection](https://developer.mozilla.org/en/docs/Web/API/HTMLCollection) to Kotlin @@ -4541,19 +4493,15 @@ public external abstract class HTMLCollection : ItemArrayLike, UnionEle fun namedItem(name: String): Element? } -@PublishedApi @Suppress("UNUSED_PARAMETER") internal fun getMethodImplForHTMLCollection(obj: HTMLCollection, index: Int): Element? { js("return obj[index];") } -@kotlin.internal.InlineOnly -public inline operator fun HTMLCollection.get(index: Int): Element? = getMethodImplForHTMLCollection(this, index) +public operator fun HTMLCollection.get(index: Int): Element? = getMethodImplForHTMLCollection(this, index) -@PublishedApi @Suppress("UNUSED_PARAMETER") internal fun getMethodImplForHTMLCollection(obj: HTMLCollection, name: String): Element? { js("return obj[name];") } -@kotlin.internal.InlineOnly -public inline operator fun HTMLCollection.get(name: String): Element? = getMethodImplForHTMLCollection(this, name) +public operator fun HTMLCollection.get(name: String): Element? = getMethodImplForHTMLCollection(this, name) /** * Exposes the JavaScript [MutationObserver](https://developer.mozilla.org/en/docs/Web/API/MutationObserver) to Kotlin @@ -4878,12 +4826,10 @@ public external open class Document : Node, GlobalEventHandlers, DocumentAndElem } } -@PublishedApi @Suppress("UNUSED_PARAMETER") internal fun getMethodImplForDocument(obj: Document, name: String): JsAny? { js("return obj[name];") } -@kotlin.internal.InlineOnly -public inline operator fun Document.get(name: String): JsAny? = getMethodImplForDocument(this, name) +public operator fun Document.get(name: String): JsAny? = getMethodImplForDocument(this, name) /** * Exposes the JavaScript [XMLDocument](https://developer.mozilla.org/en/docs/Web/API/XMLDocument) to Kotlin @@ -5132,19 +5078,15 @@ public external abstract class NamedNodeMap : ItemArrayLike, JsAny { fun getNamedItem(qualifiedName: String): Attr? } -@PublishedApi @Suppress("UNUSED_PARAMETER") internal fun getMethodImplForNamedNodeMap(obj: NamedNodeMap, index: Int): Attr? { js("return obj[index];") } -@kotlin.internal.InlineOnly -public inline operator fun NamedNodeMap.get(index: Int): Attr? = getMethodImplForNamedNodeMap(this, index) +public operator fun NamedNodeMap.get(index: Int): Attr? = getMethodImplForNamedNodeMap(this, index) -@PublishedApi @Suppress("UNUSED_PARAMETER") internal fun getMethodImplForNamedNodeMap(obj: NamedNodeMap, qualifiedName: String): Attr? { js("return obj[qualifiedName];") } -@kotlin.internal.InlineOnly -public inline operator fun NamedNodeMap.get(qualifiedName: String): Attr? = getMethodImplForNamedNodeMap(this, qualifiedName) +public operator fun NamedNodeMap.get(qualifiedName: String): Attr? = getMethodImplForNamedNodeMap(this, qualifiedName) /** * Exposes the JavaScript [Attr](https://developer.mozilla.org/en/docs/Web/API/Attr) to Kotlin @@ -5455,12 +5397,10 @@ public external abstract class DOMTokenList : ItemArrayLike, JsAny { override fun item(index: Int): JsString? } -@PublishedApi @Suppress("UNUSED_PARAMETER") internal fun getMethodImplForDOMTokenList(obj: DOMTokenList, index: Int): String? { js("return obj[index];") } -@kotlin.internal.InlineOnly -public inline operator fun DOMTokenList.get(index: Int): String? = getMethodImplForDOMTokenList(this, index) +public operator fun DOMTokenList.get(index: Int): String? = getMethodImplForDOMTokenList(this, index) /** * Exposes the JavaScript [DOMPointReadOnly](https://developer.mozilla.org/en/docs/Web/API/DOMPointReadOnly) to Kotlin @@ -5552,12 +5492,10 @@ public external interface DOMRectList : ItemArrayLike, JsAny { override fun item(index: Int): DOMRect? } -@PublishedApi @Suppress("UNUSED_PARAMETER") internal fun getMethodImplForDOMRectList(obj: DOMRectList, index: Int): DOMRect? { js("return obj[index];") } -@kotlin.internal.InlineOnly -public inline operator fun DOMRectList.get(index: Int): DOMRect? = getMethodImplForDOMRectList(this, index) +public operator fun DOMRectList.get(index: Int): DOMRect? = getMethodImplForDOMRectList(this, index) /** * Exposes the JavaScript [DOMQuad](https://developer.mozilla.org/en/docs/Web/API/DOMQuad) to Kotlin @@ -5814,12 +5752,10 @@ public external abstract class TouchList : ItemArrayLike, JsAny { override fun item(index: Int): Touch? } -@PublishedApi @Suppress("UNUSED_PARAMETER") internal fun getMethodImplForTouchList(obj: TouchList, index: Int): Touch? { js("return obj[index];") } -@kotlin.internal.InlineOnly -public inline operator fun TouchList.get(index: Int): Touch? = getMethodImplForTouchList(this, index) +public operator fun TouchList.get(index: Int): Touch? = getMethodImplForTouchList(this, index) public external open class TouchEvent : UIEvent, JsAny { open val touches: TouchList diff --git a/libraries/stdlib/wasm/src/org.w3c/org.w3c.dom.mediasource.kt b/libraries/stdlib/wasm/src/org.w3c/org.w3c.dom.mediasource.kt index 72b21a65ad1..ce9da48861a 100644 --- a/libraries/stdlib/wasm/src/org.w3c/org.w3c.dom.mediasource.kt +++ b/libraries/stdlib/wasm/src/org.w3c/org.w3c.dom.mediasource.kt @@ -67,12 +67,10 @@ public external abstract class SourceBufferList : EventTarget, JsAny { open var onremovesourcebuffer: ((Event) -> JsAny?)? } -@PublishedApi @Suppress("UNUSED_PARAMETER") internal fun getMethodImplForSourceBufferList(obj: SourceBufferList, index: Int): SourceBuffer? { js("return obj[index];") } -@kotlin.internal.InlineOnly -public inline operator fun SourceBufferList.get(index: Int): SourceBuffer? = getMethodImplForSourceBufferList(this, index) +public operator fun SourceBufferList.get(index: Int): SourceBuffer? = getMethodImplForSourceBufferList(this, index) /* please, don't implement this interface! */ @JsName("null") diff --git a/libraries/stdlib/wasm/src/org.w3c/org.w3c.dom.svg.kt b/libraries/stdlib/wasm/src/org.w3c/org.w3c.dom.svg.kt index 779439fa3b5..b8d4031bdd6 100644 --- a/libraries/stdlib/wasm/src/org.w3c/org.w3c.dom.svg.kt +++ b/libraries/stdlib/wasm/src/org.w3c/org.w3c.dom.svg.kt @@ -192,19 +192,15 @@ public external abstract class SVGNameList : JsAny { fun getItem(index: Int): JsAny? } -@PublishedApi @Suppress("UNUSED_PARAMETER") internal fun getMethodImplForSVGNameList(obj: SVGNameList, index: Int): JsAny? { js("return obj[index];") } -@kotlin.internal.InlineOnly -public inline operator fun SVGNameList.get(index: Int): JsAny? = getMethodImplForSVGNameList(this, index) +public operator fun SVGNameList.get(index: Int): JsAny? = getMethodImplForSVGNameList(this, index) -@PublishedApi @Suppress("UNUSED_PARAMETER") internal fun setMethodImplForSVGNameList(obj: SVGNameList, index: Int, newItem: JsAny?) { js("obj[index] = newItem;") } -@kotlin.internal.InlineOnly -public inline operator fun SVGNameList.set(index: Int, newItem: JsAny?) = setMethodImplForSVGNameList(this, index, newItem) +public operator fun SVGNameList.set(index: Int, newItem: JsAny?) = setMethodImplForSVGNameList(this, index, newItem) /** * Exposes the JavaScript [SVGNumberList](https://developer.mozilla.org/en/docs/Web/API/SVGNumberList) to Kotlin @@ -221,19 +217,15 @@ public external abstract class SVGNumberList : JsAny { fun getItem(index: Int): SVGNumber } -@PublishedApi @Suppress("UNUSED_PARAMETER") internal fun getMethodImplForSVGNumberList(obj: SVGNumberList, index: Int): SVGNumber? { js("return obj[index];") } -@kotlin.internal.InlineOnly -public inline operator fun SVGNumberList.get(index: Int): SVGNumber? = getMethodImplForSVGNumberList(this, index) +public operator fun SVGNumberList.get(index: Int): SVGNumber? = getMethodImplForSVGNumberList(this, index) -@PublishedApi @Suppress("UNUSED_PARAMETER") internal fun setMethodImplForSVGNumberList(obj: SVGNumberList, index: Int, newItem: SVGNumber) { js("obj[index] = newItem;") } -@kotlin.internal.InlineOnly -public inline operator fun SVGNumberList.set(index: Int, newItem: SVGNumber) = setMethodImplForSVGNumberList(this, index, newItem) +public operator fun SVGNumberList.set(index: Int, newItem: SVGNumber) = setMethodImplForSVGNumberList(this, index, newItem) /** * Exposes the JavaScript [SVGLengthList](https://developer.mozilla.org/en/docs/Web/API/SVGLengthList) to Kotlin @@ -250,19 +242,15 @@ public external abstract class SVGLengthList : JsAny { fun getItem(index: Int): SVGLength } -@PublishedApi @Suppress("UNUSED_PARAMETER") internal fun getMethodImplForSVGLengthList(obj: SVGLengthList, index: Int): SVGLength? { js("return obj[index];") } -@kotlin.internal.InlineOnly -public inline operator fun SVGLengthList.get(index: Int): SVGLength? = getMethodImplForSVGLengthList(this, index) +public operator fun SVGLengthList.get(index: Int): SVGLength? = getMethodImplForSVGLengthList(this, index) -@PublishedApi @Suppress("UNUSED_PARAMETER") internal fun setMethodImplForSVGLengthList(obj: SVGLengthList, index: Int, newItem: SVGLength) { js("obj[index] = newItem;") } -@kotlin.internal.InlineOnly -public inline operator fun SVGLengthList.set(index: Int, newItem: SVGLength) = setMethodImplForSVGLengthList(this, index, newItem) +public operator fun SVGLengthList.set(index: Int, newItem: SVGLength) = setMethodImplForSVGLengthList(this, index, newItem) /** * Exposes the JavaScript [SVGAnimatedBoolean](https://developer.mozilla.org/en/docs/Web/API/SVGAnimatedBoolean) to Kotlin @@ -359,19 +347,15 @@ public external abstract class SVGStringList : JsAny { fun getItem(index: Int): String } -@PublishedApi @Suppress("UNUSED_PARAMETER") internal fun getMethodImplForSVGStringList(obj: SVGStringList, index: Int): String? { js("return obj[index];") } -@kotlin.internal.InlineOnly -public inline operator fun SVGStringList.get(index: Int): String? = getMethodImplForSVGStringList(this, index) +public operator fun SVGStringList.get(index: Int): String? = getMethodImplForSVGStringList(this, index) -@PublishedApi @Suppress("UNUSED_PARAMETER") internal fun setMethodImplForSVGStringList(obj: SVGStringList, index: Int, newItem: String) { js("obj[index] = newItem;") } -@kotlin.internal.InlineOnly -public inline operator fun SVGStringList.set(index: Int, newItem: String) = setMethodImplForSVGStringList(this, index, newItem) +public operator fun SVGStringList.set(index: Int, newItem: String) = setMethodImplForSVGStringList(this, index, newItem) /** * Exposes the JavaScript [SVGUnitTypes](https://developer.mozilla.org/en/docs/Web/API/SVGUnitTypes) to Kotlin @@ -821,19 +805,15 @@ public external abstract class SVGTransformList : JsAny { fun getItem(index: Int): SVGTransform } -@PublishedApi @Suppress("UNUSED_PARAMETER") internal fun getMethodImplForSVGTransformList(obj: SVGTransformList, index: Int): SVGTransform? { js("return obj[index];") } -@kotlin.internal.InlineOnly -public inline operator fun SVGTransformList.get(index: Int): SVGTransform? = getMethodImplForSVGTransformList(this, index) +public operator fun SVGTransformList.get(index: Int): SVGTransform? = getMethodImplForSVGTransformList(this, index) -@PublishedApi @Suppress("UNUSED_PARAMETER") internal fun setMethodImplForSVGTransformList(obj: SVGTransformList, index: Int, newItem: SVGTransform) { js("obj[index] = newItem;") } -@kotlin.internal.InlineOnly -public inline operator fun SVGTransformList.set(index: Int, newItem: SVGTransform) = setMethodImplForSVGTransformList(this, index, newItem) +public operator fun SVGTransformList.set(index: Int, newItem: SVGTransform) = setMethodImplForSVGTransformList(this, index, newItem) /** * Exposes the JavaScript [SVGAnimatedTransformList](https://developer.mozilla.org/en/docs/Web/API/SVGAnimatedTransformList) to Kotlin @@ -1073,19 +1053,15 @@ public external abstract class SVGPointList : JsAny { fun getItem(index: Int): DOMPoint } -@PublishedApi @Suppress("UNUSED_PARAMETER") internal fun getMethodImplForSVGPointList(obj: SVGPointList, index: Int): DOMPoint? { js("return obj[index];") } -@kotlin.internal.InlineOnly -public inline operator fun SVGPointList.get(index: Int): DOMPoint? = getMethodImplForSVGPointList(this, index) +public operator fun SVGPointList.get(index: Int): DOMPoint? = getMethodImplForSVGPointList(this, index) -@PublishedApi @Suppress("UNUSED_PARAMETER") internal fun setMethodImplForSVGPointList(obj: SVGPointList, index: Int, newItem: DOMPoint) { js("obj[index] = newItem;") } -@kotlin.internal.InlineOnly -public inline operator fun SVGPointList.set(index: Int, newItem: DOMPoint) = setMethodImplForSVGPointList(this, index, newItem) +public operator fun SVGPointList.set(index: Int, newItem: DOMPoint) = setMethodImplForSVGPointList(this, index, newItem) /** * Exposes the JavaScript [SVGPolylineElement](https://developer.mozilla.org/en/docs/Web/API/SVGPolylineElement) to Kotlin diff --git a/libraries/stdlib/wasm/src/org.w3c/org.w3c.files.kt b/libraries/stdlib/wasm/src/org.w3c/org.w3c.files.kt index a19b0544b44..cd7c70be807 100644 --- a/libraries/stdlib/wasm/src/org.w3c/org.w3c.files.kt +++ b/libraries/stdlib/wasm/src/org.w3c/org.w3c.files.kt @@ -58,12 +58,10 @@ public external abstract class FileList : ItemArrayLike, JsAny { override fun item(index: Int): File? } -@PublishedApi @Suppress("UNUSED_PARAMETER") internal fun getMethodImplForFileList(obj: FileList, index: Int): File? { js("return obj[index];") } -@kotlin.internal.InlineOnly -public inline operator fun FileList.get(index: Int): File? = getMethodImplForFileList(this, index) +public operator fun FileList.get(index: Int): File? = getMethodImplForFileList(this, index) /** * Exposes the JavaScript [FileReader](https://developer.mozilla.org/en/docs/Web/API/FileReader) to Kotlin diff --git a/libraries/tools/dukat/src/main/kotlin/org/jetbrains/kotlin/tools/dukat/wasm/convertToModel.kt b/libraries/tools/dukat/src/main/kotlin/org/jetbrains/kotlin/tools/dukat/wasm/convertToModel.kt index 3c4710ceb62..489a3b4b19c 100644 --- a/libraries/tools/dukat/src/main/kotlin/org/jetbrains/kotlin/tools/dukat/wasm/convertToModel.kt +++ b/libraries/tools/dukat/src/main/kotlin/org/jetbrains/kotlin/tools/dukat/wasm/convertToModel.kt @@ -297,7 +297,6 @@ private class IdlFileConverter( extend = null, operator = false, annotations = mutableListOf( - PUBLISHED_API_ANNOTATION, SUPPRESS_UNUSED_PARAMETER_ANNOTATION, ), body = BlockStatementModel( @@ -316,10 +315,9 @@ private class IdlFileConverter( type = unitType, typeParameters = listOf(), annotations = mutableListOf( - INLINE_ONLY_ANNOTATION ), export = false, - inline = true, + inline = false, operator = true, extend = ClassLikeReferenceModel( name = ownerName, @@ -341,7 +339,7 @@ private class IdlFileConverter( ), visibilityModifier = VisibilityModifierModel.PUBLIC, comment = null, - external = true + external = false ) return listOf(privateSetterImpl, publicSetter) } @@ -371,7 +369,6 @@ private class IdlFileConverter( extend = null, operator = false, annotations = mutableListOf( - PUBLISHED_API_ANNOTATION, SUPPRESS_UNUSED_PARAMETER_ANNOTATION ), body = BlockStatementModel( @@ -390,10 +387,9 @@ private class IdlFileConverter( type = valueType.toNullableIfNotPrimitive().convertToModel(), typeParameters = listOf(), annotations = mutableListOf( - INLINE_ONLY_ANNOTATION ), export = false, - inline = true, + inline = false, operator = true, extend = ClassLikeReferenceModel( name = ownerName, @@ -411,7 +407,7 @@ private class IdlFileConverter( ), visibilityModifier = VisibilityModifierModel.PUBLIC, comment = null, - external = true + external = false ) return listOf(privateGetterImpl, publicGetter)