"js" -> "kotlin.js"
This commit is contained in:
@@ -4,5 +4,5 @@ import <caret>
|
||||
|
||||
// EXIST: java,
|
||||
// EXIST_JAVA_ONLY: javax
|
||||
// EXIST_JS_ONLY: js
|
||||
// ABSENT: Array, Integer
|
||||
// EXIST_JS_ONLY: jquery, html5
|
||||
// ABSENT: Array, Integer
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
package js.<caret>
|
||||
package kotlin.js.<caret>
|
||||
|
||||
// EXIST: dom
|
||||
// ABSENT: Date, JSON, capitalize
|
||||
// ABSENT: Date, JSON, capitalize
|
||||
|
||||
@@ -2,5 +2,5 @@ fun main(args: Array<String>) {
|
||||
println<caret>
|
||||
}
|
||||
|
||||
// For KT-3620: Don't auto-import js.* and remove in `optimize imports`
|
||||
// JS
|
||||
// For KT-3620: Don't auto-import kotlin.js.* and remove in `optimize imports`
|
||||
// JS
|
||||
|
||||
@@ -2,5 +2,5 @@ fun main(args: Array<String>) {
|
||||
println()
|
||||
}
|
||||
|
||||
// For KT-3620: Don't auto-import js.* and remove in `optimize imports`
|
||||
// JS
|
||||
// For KT-3620: Don't auto-import kotlin.js.* and remove in `optimize imports`
|
||||
// JS
|
||||
|
||||
@@ -2,5 +2,5 @@ fun main(args: Array<String>) {
|
||||
val a: Json? = null
|
||||
}
|
||||
|
||||
// For KT-3620 Don't auto-import js.* and remove in `optimize imports`
|
||||
// JS
|
||||
// For KT-3620 Don't auto-import kotlin.js.* and remove in `optimize imports`
|
||||
// JS
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
import js.Json
|
||||
import kotlin.js.Json
|
||||
|
||||
fun main(args: Array<String>) {
|
||||
val a: Json? = null
|
||||
}
|
||||
|
||||
// For KT-3620 Don't auto-import js.* and remove in `optimize imports`
|
||||
// JS
|
||||
// For KT-3620 Don't auto-import kotlin.js.* and remove in `optimize imports`
|
||||
// JS
|
||||
|
||||
@@ -41,9 +41,9 @@ import java.util.List;
|
||||
|
||||
public final class TopDownAnalyzerFacadeForJS {
|
||||
public static final List<ImportPath> DEFAULT_IMPORTS = ImmutableList.of(
|
||||
new ImportPath("js.*"),
|
||||
new ImportPath("java.lang.*"),
|
||||
new ImportPath("kotlin.*")
|
||||
new ImportPath("kotlin.*"),
|
||||
new ImportPath("kotlin.js.*")
|
||||
);
|
||||
|
||||
private TopDownAnalyzerFacadeForJS() {
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
package js;
|
||||
package kotlin.js;
|
||||
|
||||
native
|
||||
public annotation class native(name : String = "")
|
||||
|
||||
@@ -1,9 +1,6 @@
|
||||
package js;
|
||||
package kotlin.js;
|
||||
|
||||
import js.library
|
||||
import js.native
|
||||
import java.util.*;
|
||||
import java.lang.*;
|
||||
|
||||
native
|
||||
public val noImpl : Nothing = throw Exception()
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
package js
|
||||
package kotlin.js
|
||||
|
||||
native
|
||||
public class Date() {
|
||||
public fun getTime() : Int = js.noImpl
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,6 +1,4 @@
|
||||
package js.debug
|
||||
|
||||
import js.noImpl
|
||||
package kotlin.js
|
||||
|
||||
// https://developer.mozilla.org/en/DOM/console
|
||||
native trait Console {
|
||||
@@ -12,4 +10,4 @@ native trait Console {
|
||||
}
|
||||
|
||||
native
|
||||
val console:Console = noImpl
|
||||
val console:Console = noImpl
|
||||
|
||||
@@ -8,8 +8,6 @@ package org.w3c.dom
|
||||
// See: https://github.com/JetBrains/kotlin/tree/master/libraries/stdlib
|
||||
//
|
||||
|
||||
import js.noImpl
|
||||
|
||||
// Contains stub APIs for the W3C DOM API so we can delegate to the platform DOM instead
|
||||
|
||||
|
||||
@@ -19,7 +17,7 @@ native public trait Attr: Node {
|
||||
public val schemaTypeInfo: TypeInfo
|
||||
public val specified: Boolean
|
||||
public var value: String
|
||||
public fun isId(): Boolean = js.noImpl
|
||||
public fun isId(): Boolean = noImpl
|
||||
}
|
||||
|
||||
native public trait CDATASection: Text {
|
||||
@@ -28,11 +26,11 @@ native public trait CDATASection: Text {
|
||||
native public trait CharacterData: Node {
|
||||
public var data: String
|
||||
public val length: Int
|
||||
public fun appendData(arg1: String?): Unit = js.noImpl
|
||||
public fun deleteData(arg1: Int, arg2: Int): Unit = js.noImpl
|
||||
public fun insertData(arg1: Int, arg2: String?): Unit = js.noImpl
|
||||
public fun replaceData(arg1: Int, arg2: Int, arg3: String?): Unit = js.noImpl
|
||||
public fun substringData(arg1: Int, arg2: Int): String = js.noImpl
|
||||
public fun appendData(arg1: String?): Unit = noImpl
|
||||
public fun deleteData(arg1: Int, arg2: Int): Unit = noImpl
|
||||
public fun insertData(arg1: Int, arg2: String?): Unit = noImpl
|
||||
public fun replaceData(arg1: Int, arg2: Int, arg3: String?): Unit = noImpl
|
||||
public fun substringData(arg1: Int, arg2: Int): String = noImpl
|
||||
}
|
||||
|
||||
native public trait Comment: CharacterData {
|
||||
@@ -49,23 +47,23 @@ native public trait Document: Node {
|
||||
public val xmlEncoding: String
|
||||
public var xmlStandalone: Boolean
|
||||
public var xmlVersion: String
|
||||
public fun adoptNode(arg1: Node): Node = js.noImpl
|
||||
public fun createAttribute(arg1: String?): Attr = js.noImpl
|
||||
public fun createAttributeNS(arg1: String?, arg2: String?): Attr = js.noImpl
|
||||
public fun createCDATASection(arg1: String?): CDATASection = js.noImpl
|
||||
public fun createComment(arg1: String?): Comment = js.noImpl
|
||||
public fun createDocumentFragment(): DocumentFragment = js.noImpl
|
||||
public fun createElement(arg1: String?): Element = js.noImpl
|
||||
public fun createElementNS(arg1: String?, arg2: String?): Element = js.noImpl
|
||||
public fun createEntityReference(arg1: String?): EntityReference = js.noImpl
|
||||
public fun createProcessingInstruction(arg1: String?, arg2: String?): ProcessingInstruction = js.noImpl
|
||||
public fun createTextNode(arg1: String?): Text = js.noImpl
|
||||
public fun getElementById(arg1: String?): Element = js.noImpl
|
||||
public fun getElementsByTagName(arg1: String?): NodeList = js.noImpl
|
||||
public fun getElementsByTagNameNS(arg1: String?, arg2: String?): NodeList = js.noImpl
|
||||
public fun importNode(arg1: Node, arg2: Boolean): Node = js.noImpl
|
||||
public fun normalizeDocument(): Unit = js.noImpl
|
||||
public fun renameNode(arg1: Node, arg2: String?, arg3: String?): Node = js.noImpl
|
||||
public fun adoptNode(arg1: Node): Node = noImpl
|
||||
public fun createAttribute(arg1: String?): Attr = noImpl
|
||||
public fun createAttributeNS(arg1: String?, arg2: String?): Attr = noImpl
|
||||
public fun createCDATASection(arg1: String?): CDATASection = noImpl
|
||||
public fun createComment(arg1: String?): Comment = noImpl
|
||||
public fun createDocumentFragment(): DocumentFragment = noImpl
|
||||
public fun createElement(arg1: String?): Element = noImpl
|
||||
public fun createElementNS(arg1: String?, arg2: String?): Element = noImpl
|
||||
public fun createEntityReference(arg1: String?): EntityReference = noImpl
|
||||
public fun createProcessingInstruction(arg1: String?, arg2: String?): ProcessingInstruction = noImpl
|
||||
public fun createTextNode(arg1: String?): Text = noImpl
|
||||
public fun getElementById(arg1: String?): Element = noImpl
|
||||
public fun getElementsByTagName(arg1: String?): NodeList = noImpl
|
||||
public fun getElementsByTagNameNS(arg1: String?, arg2: String?): NodeList = noImpl
|
||||
public fun importNode(arg1: Node, arg2: Boolean): Node = noImpl
|
||||
public fun normalizeDocument(): Unit = noImpl
|
||||
public fun renameNode(arg1: Node, arg2: String?, arg3: String?): Node = noImpl
|
||||
}
|
||||
|
||||
native public trait DocumentFragment: Node {
|
||||
@@ -82,9 +80,9 @@ native public trait DocumentType: Node {
|
||||
|
||||
native public trait DOMConfiguration {
|
||||
public val parameterNames: DOMStringList
|
||||
public fun canSetParameter(arg1: String?, arg2: Any): Boolean = js.noImpl
|
||||
public fun getParameter(arg1: String?): Any = js.noImpl
|
||||
public fun setParameter(arg1: String?, arg2: Any): Unit = js.noImpl
|
||||
public fun canSetParameter(arg1: String?, arg2: Any): Boolean = noImpl
|
||||
public fun getParameter(arg1: String?): Any = noImpl
|
||||
public fun setParameter(arg1: String?, arg2: Any): Unit = noImpl
|
||||
}
|
||||
|
||||
native public trait DOMError {
|
||||
@@ -103,19 +101,19 @@ native public trait DOMError {
|
||||
}
|
||||
|
||||
native public trait DOMErrorHandler {
|
||||
public fun handleError(arg1: DOMError): Boolean = js.noImpl
|
||||
public fun handleError(arg1: DOMError): Boolean = noImpl
|
||||
}
|
||||
|
||||
native public trait DOMImplementation {
|
||||
public fun createDocument(arg1: String?, arg2: String?, arg3: DocumentType?): Document = js.noImpl
|
||||
public fun createDocumentType(arg1: String?, arg2: String?, arg3: String?): DocumentType = js.noImpl
|
||||
public fun getFeature(arg1: String?, arg2: String?): Any = js.noImpl
|
||||
public fun hasFeature(arg1: String?, arg2: String?): Boolean = js.noImpl
|
||||
public fun createDocument(arg1: String?, arg2: String?, arg3: DocumentType?): Document = noImpl
|
||||
public fun createDocumentType(arg1: String?, arg2: String?, arg3: String?): DocumentType = noImpl
|
||||
public fun getFeature(arg1: String?, arg2: String?): Any = noImpl
|
||||
public fun hasFeature(arg1: String?, arg2: String?): Boolean = noImpl
|
||||
}
|
||||
|
||||
native public trait DOMImplementationList {
|
||||
public val length: Int
|
||||
public fun item(arg1: Int): DOMImplementation = js.noImpl
|
||||
public fun item(arg1: Int): DOMImplementation = noImpl
|
||||
}
|
||||
|
||||
native public trait DOMLocator {
|
||||
@@ -129,31 +127,31 @@ native public trait DOMLocator {
|
||||
|
||||
native public trait DOMStringList {
|
||||
public val length: Int
|
||||
public fun contains(arg1: String?): Boolean = js.noImpl
|
||||
public fun item(arg1: Int): String = js.noImpl
|
||||
public fun contains(arg1: String?): Boolean = noImpl
|
||||
public fun item(arg1: Int): String = noImpl
|
||||
}
|
||||
|
||||
native public trait Element: Node {
|
||||
public val schemaTypeInfo: TypeInfo
|
||||
public val tagName: String
|
||||
public fun getAttribute(arg1: String?): String = js.noImpl
|
||||
public fun getAttributeNS(arg1: String?, arg2: String?): String = js.noImpl
|
||||
public fun getAttributeNode(arg1: String?): Attr = js.noImpl
|
||||
public fun getAttributeNodeNS(arg1: String?, arg2: String?): Attr = js.noImpl
|
||||
public fun getElementsByTagName(arg1: String?): NodeList = js.noImpl
|
||||
public fun getElementsByTagNameNS(arg1: String?, arg2: String?): NodeList = js.noImpl
|
||||
public fun hasAttribute(arg1: String?): Boolean = js.noImpl
|
||||
public fun hasAttributeNS(arg1: String?, arg2: String?): Boolean = js.noImpl
|
||||
public fun removeAttribute(arg1: String?): Unit = js.noImpl
|
||||
public fun removeAttributeNS(arg1: String?, arg2: String?): Unit = js.noImpl
|
||||
public fun removeAttributeNode(arg1: Attr): Attr = js.noImpl
|
||||
public fun setAttribute(arg1: String?, arg2: String?): Unit = js.noImpl
|
||||
public fun setAttributeNS(arg1: String?, arg2: String?, arg3: String?): Unit = js.noImpl
|
||||
public fun setIdAttribute(arg1: String?, arg2: Boolean): Unit = js.noImpl
|
||||
public fun setIdAttributeNS(arg1: String?, arg2: String?, arg3: Boolean): Unit = js.noImpl
|
||||
public fun setIdAttributeNode(arg1: Attr, arg2: Boolean): Unit = js.noImpl
|
||||
public fun setAttributeNode(arg1: Attr): Attr = js.noImpl
|
||||
public fun setAttributeNodeNS(arg1: Attr): Attr = js.noImpl
|
||||
public fun getAttribute(arg1: String?): String = noImpl
|
||||
public fun getAttributeNS(arg1: String?, arg2: String?): String = noImpl
|
||||
public fun getAttributeNode(arg1: String?): Attr = noImpl
|
||||
public fun getAttributeNodeNS(arg1: String?, arg2: String?): Attr = noImpl
|
||||
public fun getElementsByTagName(arg1: String?): NodeList = noImpl
|
||||
public fun getElementsByTagNameNS(arg1: String?, arg2: String?): NodeList = noImpl
|
||||
public fun hasAttribute(arg1: String?): Boolean = noImpl
|
||||
public fun hasAttributeNS(arg1: String?, arg2: String?): Boolean = noImpl
|
||||
public fun removeAttribute(arg1: String?): Unit = noImpl
|
||||
public fun removeAttributeNS(arg1: String?, arg2: String?): Unit = noImpl
|
||||
public fun removeAttributeNode(arg1: Attr): Attr = noImpl
|
||||
public fun setAttribute(arg1: String?, arg2: String?): Unit = noImpl
|
||||
public fun setAttributeNS(arg1: String?, arg2: String?, arg3: String?): Unit = noImpl
|
||||
public fun setIdAttribute(arg1: String?, arg2: Boolean): Unit = noImpl
|
||||
public fun setIdAttributeNS(arg1: String?, arg2: String?, arg3: Boolean): Unit = noImpl
|
||||
public fun setIdAttributeNode(arg1: Attr, arg2: Boolean): Unit = noImpl
|
||||
public fun setAttributeNode(arg1: Attr): Attr = noImpl
|
||||
public fun setAttributeNodeNS(arg1: Attr): Attr = noImpl
|
||||
}
|
||||
|
||||
native public trait Entity: Node {
|
||||
@@ -170,21 +168,21 @@ native public trait EntityReference: Node {
|
||||
|
||||
native public trait NameList {
|
||||
public val length: Int
|
||||
public fun contains(arg1: String?): Boolean = js.noImpl
|
||||
public fun containsNS(arg1: String?, arg2: String?): Boolean = js.noImpl
|
||||
public fun getName(arg1: Int): String = js.noImpl
|
||||
public fun getNamespaceURI(arg1: Int): String = js.noImpl
|
||||
public fun contains(arg1: String?): Boolean = noImpl
|
||||
public fun containsNS(arg1: String?, arg2: String?): Boolean = noImpl
|
||||
public fun getName(arg1: Int): String = noImpl
|
||||
public fun getNamespaceURI(arg1: Int): String = noImpl
|
||||
}
|
||||
|
||||
native public trait NamedNodeMap {
|
||||
public val length: Int
|
||||
public fun getNamedItem(arg1: String?): Node = js.noImpl
|
||||
public fun getNamedItemNS(arg1: String?, arg2: String?): Node = js.noImpl
|
||||
public fun item(arg1: Int): Node = js.noImpl
|
||||
public fun removeNamedItem(arg1: String?): Node = js.noImpl
|
||||
public fun removeNamedItemNS(arg1: String?, arg2: String?): Node = js.noImpl
|
||||
public fun setNamedItem(arg1: Node): Node = js.noImpl
|
||||
public fun setNamedItemNS(arg1: Node): Node = js.noImpl
|
||||
public fun getNamedItem(arg1: String?): Node = noImpl
|
||||
public fun getNamedItemNS(arg1: String?, arg2: String?): Node = noImpl
|
||||
public fun item(arg1: Int): Node = noImpl
|
||||
public fun removeNamedItem(arg1: String?): Node = noImpl
|
||||
public fun removeNamedItemNS(arg1: String?, arg2: String?): Node = noImpl
|
||||
public fun setNamedItem(arg1: Node): Node = noImpl
|
||||
public fun setNamedItemNS(arg1: Node): Node = noImpl
|
||||
}
|
||||
|
||||
native public trait Node {
|
||||
@@ -204,24 +202,24 @@ native public trait Node {
|
||||
public var prefix: String
|
||||
public val previousSibling: Node
|
||||
public var textContent: String
|
||||
public fun appendChild(arg1: Node): Node = js.noImpl
|
||||
public fun cloneNode(arg1: Boolean): Node = js.noImpl
|
||||
public fun compareDocumentPosition(arg1: Node): Short = js.noImpl
|
||||
public fun getFeature(arg1: String?, arg2: String?): Any = js.noImpl
|
||||
public fun getUserData(arg1: String?): Any = js.noImpl
|
||||
public fun hasAttributes(): Boolean = js.noImpl
|
||||
public fun hasChildNodes(): Boolean = js.noImpl
|
||||
public fun insertBefore(arg1: Node, arg2: Node): Node = js.noImpl
|
||||
public fun isDefaultNamespace(arg1: String?): Boolean = js.noImpl
|
||||
public fun isEqualNode(arg1: Node): Boolean = js.noImpl
|
||||
public fun isSameNode(arg1: Node): Boolean = js.noImpl
|
||||
public fun isSupported(arg1: String?, arg2: String?): Boolean = js.noImpl
|
||||
public fun lookupNamespaceURI(arg1: String?): String = js.noImpl
|
||||
public fun lookupPrefix(arg1: String?): String = js.noImpl
|
||||
public fun normalize(): Unit = js.noImpl
|
||||
public fun removeChild(arg1: Node): Node = js.noImpl
|
||||
public fun replaceChild(arg1: Node, arg2: Node): Node = js.noImpl
|
||||
public fun setUserData(arg1: String?, arg2: Any, arg3: UserDataHandler): Any = js.noImpl
|
||||
public fun appendChild(arg1: Node): Node = noImpl
|
||||
public fun cloneNode(arg1: Boolean): Node = noImpl
|
||||
public fun compareDocumentPosition(arg1: Node): Short = noImpl
|
||||
public fun getFeature(arg1: String?, arg2: String?): Any = noImpl
|
||||
public fun getUserData(arg1: String?): Any = noImpl
|
||||
public fun hasAttributes(): Boolean = noImpl
|
||||
public fun hasChildNodes(): Boolean = noImpl
|
||||
public fun insertBefore(arg1: Node, arg2: Node): Node = noImpl
|
||||
public fun isDefaultNamespace(arg1: String?): Boolean = noImpl
|
||||
public fun isEqualNode(arg1: Node): Boolean = noImpl
|
||||
public fun isSameNode(arg1: Node): Boolean = noImpl
|
||||
public fun isSupported(arg1: String?, arg2: String?): Boolean = noImpl
|
||||
public fun lookupNamespaceURI(arg1: String?): String = noImpl
|
||||
public fun lookupPrefix(arg1: String?): String = noImpl
|
||||
public fun normalize(): Unit = noImpl
|
||||
public fun removeChild(arg1: Node): Node = noImpl
|
||||
public fun replaceChild(arg1: Node, arg2: Node): Node = noImpl
|
||||
public fun setUserData(arg1: String?, arg2: Any, arg3: UserDataHandler): Any = noImpl
|
||||
|
||||
public class object {
|
||||
public val ATTRIBUTE_NODE: Short = 2
|
||||
@@ -247,7 +245,7 @@ native public trait Node {
|
||||
|
||||
native public trait NodeList {
|
||||
public val length: Int
|
||||
public fun item(arg1: Int): Node = js.noImpl
|
||||
public fun item(arg1: Int): Node = noImpl
|
||||
}
|
||||
|
||||
native public trait Notation: Node {
|
||||
@@ -262,15 +260,15 @@ native public trait ProcessingInstruction: Node {
|
||||
|
||||
native public trait Text: CharacterData {
|
||||
public val wholeText: String
|
||||
public fun isElementContentWhitespace(): Boolean = js.noImpl
|
||||
public fun replaceWholeText(arg1: String?): Text = js.noImpl
|
||||
public fun splitText(arg1: Int): Text = js.noImpl
|
||||
public fun isElementContentWhitespace(): Boolean = noImpl
|
||||
public fun replaceWholeText(arg1: String?): Text = noImpl
|
||||
public fun splitText(arg1: Int): Text = noImpl
|
||||
}
|
||||
|
||||
native public trait TypeInfo {
|
||||
public val typeName: String
|
||||
public val typeNamespace: String
|
||||
public fun isDerivedFrom(arg1: String?, arg2: String?, arg3: Int): Boolean = js.noImpl
|
||||
public fun isDerivedFrom(arg1: String?, arg2: String?, arg3: Int): Boolean = noImpl
|
||||
|
||||
public class object {
|
||||
public val DERIVATION_EXTENSION: Int = 2
|
||||
@@ -281,7 +279,7 @@ native public trait TypeInfo {
|
||||
}
|
||||
|
||||
native public trait UserDataHandler {
|
||||
public fun handle(arg1: Short, arg2: String?, arg3: Any, arg4: Node, arg5: Node): Unit = js.noImpl
|
||||
public fun handle(arg1: Short, arg2: String?, arg3: Any, arg4: Node, arg5: Node): Unit = noImpl
|
||||
|
||||
public class object {
|
||||
public val NODE_ADOPTED: Short = 5
|
||||
|
||||
@@ -10,13 +10,11 @@ import org.w3c.dom.views.*
|
||||
// See: https://github.com/JetBrains/kotlin/tree/master/libraries/stdlib
|
||||
//
|
||||
|
||||
import js.noImpl
|
||||
|
||||
// Contains stub APIs for the W3C DOM API so we can delegate to the platform DOM instead
|
||||
|
||||
|
||||
native public trait DocumentEvent {
|
||||
public fun createEvent(arg1: String?): Event = js.noImpl
|
||||
public fun createEvent(arg1: String?): Event = noImpl
|
||||
}
|
||||
|
||||
native public trait Event {
|
||||
@@ -27,9 +25,9 @@ native public trait Event {
|
||||
public val eventPhase: Short
|
||||
public val target: EventTarget
|
||||
public val timeStamp: Long
|
||||
public fun initEvent(arg1: String?, arg2: Boolean, arg3: Boolean): Unit = js.noImpl
|
||||
public fun preventDefault(): Unit = js.noImpl
|
||||
public fun stopPropagation(): Unit = js.noImpl
|
||||
public fun initEvent(arg1: String?, arg2: Boolean, arg3: Boolean): Unit = noImpl
|
||||
public fun preventDefault(): Unit = noImpl
|
||||
public fun stopPropagation(): Unit = noImpl
|
||||
|
||||
public class object {
|
||||
public val AT_TARGET: Short = 2
|
||||
@@ -39,9 +37,9 @@ native public trait Event {
|
||||
}
|
||||
|
||||
native public trait EventTarget {
|
||||
public fun addEventListener(arg1: String?, arg2: EventListener, arg3: Boolean): Unit = js.noImpl
|
||||
public fun dispatchEvent(arg1: Event?): Boolean = js.noImpl
|
||||
public fun removeEventListener(arg1: String?, arg2: EventListener, arg3: Boolean): Unit = js.noImpl
|
||||
public fun addEventListener(arg1: String?, arg2: EventListener, arg3: Boolean): Unit = noImpl
|
||||
public fun dispatchEvent(arg1: Event?): Boolean = noImpl
|
||||
public fun removeEventListener(arg1: String?, arg2: EventListener, arg3: Boolean): Unit = noImpl
|
||||
}
|
||||
|
||||
native public trait MouseEvent: UIEvent {
|
||||
@@ -55,7 +53,7 @@ native public trait MouseEvent: UIEvent {
|
||||
public val screenX: Int
|
||||
public val screenY: Int
|
||||
public val shiftKey: Boolean
|
||||
public fun initMouseEvent(arg1: String?, arg2: Boolean, arg3: Boolean, arg4: AbstractView, arg5: Int, arg6: Int, arg7: Int, arg8: Int, arg9: Int, arg10: Boolean, arg11: Boolean, arg12: Boolean, arg13: Boolean, arg14: Short, arg15: EventTarget): Unit = js.noImpl
|
||||
public fun initMouseEvent(arg1: String?, arg2: Boolean, arg3: Boolean, arg4: AbstractView, arg5: Int, arg6: Int, arg7: Int, arg8: Int, arg9: Int, arg10: Boolean, arg11: Boolean, arg12: Boolean, arg13: Boolean, arg14: Short, arg15: EventTarget): Unit = noImpl
|
||||
}
|
||||
|
||||
native public trait MutationEvent: Event {
|
||||
@@ -64,7 +62,7 @@ native public trait MutationEvent: Event {
|
||||
public val newValue: String
|
||||
public val prevValue: String
|
||||
public val relatedNode: Node
|
||||
public fun initMutationEvent(arg1: String?, arg2: Boolean, arg3: Boolean, arg4: Node, arg5: String?, arg6: String?, arg7: String?, arg8: Short): Unit = js.noImpl
|
||||
public fun initMutationEvent(arg1: String?, arg2: Boolean, arg3: Boolean, arg4: Node, arg5: String?, arg6: String?, arg7: String?, arg8: Short): Unit = noImpl
|
||||
|
||||
public class object {
|
||||
public val ADDITION: Short = 2
|
||||
@@ -76,6 +74,6 @@ native public trait MutationEvent: Event {
|
||||
native public trait UIEvent: Event {
|
||||
public val detail: Int
|
||||
public val view: AbstractView
|
||||
public fun initUIEvent(arg1: String?, arg2: Boolean, arg3: Boolean, arg4: AbstractView, arg5: Int): Unit = js.noImpl
|
||||
public fun initUIEvent(arg1: String?, arg2: Boolean, arg3: Boolean, arg4: AbstractView, arg5: Int): Unit = noImpl
|
||||
}
|
||||
|
||||
|
||||
@@ -1,7 +1,5 @@
|
||||
package org.w3c.dom.views
|
||||
|
||||
import js.noImpl
|
||||
|
||||
native public trait AbstractView {
|
||||
}
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
package js.dom.html
|
||||
package kotlin.js.dom.html
|
||||
|
||||
import org.w3c.dom.*
|
||||
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
package java.lang
|
||||
|
||||
import java.io.IOException
|
||||
import js.library
|
||||
|
||||
native("Error")
|
||||
open public class Exception(message: String? = null): Throwable() {}
|
||||
|
||||
@@ -1,6 +1,4 @@
|
||||
package js
|
||||
|
||||
import js.library
|
||||
package kotlin.js
|
||||
|
||||
native public class Json() {
|
||||
fun get(propertyName: String): Any? = js.noImpl
|
||||
@@ -31,4 +29,4 @@ public trait JsonClass {
|
||||
}
|
||||
|
||||
native
|
||||
public val JSON: JsonClass = noImpl
|
||||
public val JSON: JsonClass = noImpl
|
||||
|
||||
@@ -1,6 +1,4 @@
|
||||
package js;
|
||||
|
||||
import js.native
|
||||
package kotlin.js;
|
||||
|
||||
//TODO: declare using number
|
||||
native
|
||||
@@ -29,4 +27,4 @@ public class MathClass() {
|
||||
}
|
||||
|
||||
native
|
||||
public val Math: MathClass = MathClass();
|
||||
public val Math: MathClass = MathClass();
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
package js
|
||||
package kotlin.js
|
||||
|
||||
native public fun String.startsWith(s: String): Boolean = noImpl
|
||||
native public fun String.endsWith(s: String): Boolean = noImpl
|
||||
@@ -173,4 +173,4 @@ native public fun String.toDouble() : Double = java.lang.Double.parseDouble(this
|
||||
native public fun String.toRegex(flags: Int=0): java.util.regex.Pattern {
|
||||
return java.util.regex.Pattern.compile(this, flags)!!
|
||||
}
|
||||
*/
|
||||
*/
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
package js
|
||||
package kotlin.js
|
||||
|
||||
public inline fun String.lastIndexOf(ch : Char, fromIndex : Int) : Int = lastIndexOf(ch.toString(), fromIndex)
|
||||
public inline fun String.lastIndexOf(ch: Char) : Int = lastIndexOf(ch.toString())
|
||||
|
||||
@@ -1,8 +1,6 @@
|
||||
package js.dom.html5
|
||||
package kotlin.js.dom.html5
|
||||
|
||||
import js.native
|
||||
import js.noImpl
|
||||
import js.dom.html.HTMLElement
|
||||
import kotlin.js.dom.html.HTMLElement
|
||||
import org.w3c.dom.Element
|
||||
|
||||
public native trait HTMLCanvasElement : HTMLElement {
|
||||
|
||||
@@ -1,7 +1,5 @@
|
||||
package html5.files
|
||||
|
||||
import js.native
|
||||
|
||||
native
|
||||
class FileReader() {
|
||||
var onloadend : ((FileReaderEvent)->Unit)? = js.noImpl //
|
||||
|
||||
@@ -1,11 +1,9 @@
|
||||
package html5.localstorage
|
||||
|
||||
import js.native
|
||||
|
||||
native
|
||||
val localStorage : LocalStorageClass = js.noImpl
|
||||
native
|
||||
class LocalStorageClass() {
|
||||
fun getItem(key : String) : Any? = js.noImpl
|
||||
fun setItem(key : String, value : Any?) : Unit = js.noImpl
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
package js.jquery;
|
||||
package jquery;
|
||||
|
||||
import org.w3c.dom.Element
|
||||
|
||||
|
||||
@@ -1,10 +1,8 @@
|
||||
package js.jquery.ui
|
||||
package jquery.ui
|
||||
|
||||
|
||||
//jquery UI
|
||||
import js.jquery.JQuery
|
||||
import js.native
|
||||
import js.Json
|
||||
import jquery.JQuery
|
||||
|
||||
native
|
||||
fun JQuery.buttonset() : JQuery = js.noImpl;
|
||||
|
||||
@@ -1,7 +1,5 @@
|
||||
package QUnit
|
||||
|
||||
import js.native
|
||||
|
||||
/**
|
||||
* The [QUnit](http://qunitjs.com/) API
|
||||
*/
|
||||
|
||||
+2
-2
@@ -27,7 +27,7 @@ public final class StringOperationFIF extends CompositeFIF {
|
||||
|
||||
private StringOperationFIF() {
|
||||
add(pattern("kotlin", "String", "get"), new BuiltInFunctionIntrinsic("charAt"));
|
||||
add(pattern("js", "length").isExtensionOf("kotlin.CharSequence"), LENGTH_PROPERTY_INTRINSIC);
|
||||
add(pattern("js", "isEmpty").isExtensionOf("kotlin.CharSequence"), IS_EMPTY_INTRINSIC);
|
||||
add(pattern("kotlin.js", "length").isExtensionOf("kotlin.CharSequence"), LENGTH_PROPERTY_INTRINSIC);
|
||||
add(pattern("kotlin.js", "isEmpty").isExtensionOf("kotlin.CharSequence"), IS_EMPTY_INTRINSIC);
|
||||
}
|
||||
}
|
||||
|
||||
+3
-3
@@ -170,13 +170,13 @@ public final class TopLevelFIF extends CompositeFIF {
|
||||
add(pattern("kotlin", "iterator").isExtensionOf("kotlin.Iterator"), RETURN_RECEIVER_INTRINSIC);
|
||||
|
||||
add(pattern("kotlin", "Map", "get").checkOverridden(), NATIVE_MAP_GET);
|
||||
add(pattern("js", "set").isExtensionOf("kotlin.MutableMap"), NATIVE_MAP_SET);
|
||||
add(pattern("kotlin.js", "set").isExtensionOf("kotlin.MutableMap"), NATIVE_MAP_SET);
|
||||
|
||||
add(pattern("java.util", "HashMap", "<init>"), new MapSelectImplementationIntrinsic(false));
|
||||
add(pattern("java.util", "HashSet", "<init>"), new MapSelectImplementationIntrinsic(true));
|
||||
|
||||
add(pattern("js", "Json", "get"), ArrayFIF.GET_INTRINSIC);
|
||||
add(pattern("js", "Json", "set"), ArrayFIF.SET_INTRINSIC);
|
||||
add(pattern("kotlin.js", "Json", "get"), ArrayFIF.GET_INTRINSIC);
|
||||
add(pattern("kotlin.js", "Json", "set"), ArrayFIF.SET_INTRINSIC);
|
||||
}
|
||||
|
||||
private abstract static class NativeMapGetSet extends CallParametersAwareFunctionIntrinsic {
|
||||
|
||||
@@ -19,8 +19,8 @@ package org.jetbrains.k2js.translate.utils;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
|
||||
public enum PredefinedAnnotation {
|
||||
LIBRARY("js.library"),
|
||||
NATIVE("js.native");
|
||||
LIBRARY("kotlin.js.library"),
|
||||
NATIVE("kotlin.js.native");
|
||||
|
||||
PredefinedAnnotation(@NotNull String fqName) {
|
||||
this.fqName = fqName;
|
||||
|
||||
@@ -1,7 +1,5 @@
|
||||
package foo
|
||||
|
||||
import js.*
|
||||
|
||||
class RangeIterator(val start: Int, var count: Int, val reversed: Boolean) {
|
||||
|
||||
var i = start
|
||||
|
||||
@@ -1,7 +1,5 @@
|
||||
package a.b.c
|
||||
|
||||
import js.*
|
||||
|
||||
fun main(args: Array<String>) {
|
||||
println("ayee")
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
package kotlin.test
|
||||
|
||||
import kotlin.test.*
|
||||
import js.*
|
||||
|
||||
public var asserter: Asserter = JsTestsAsserter()
|
||||
|
||||
@@ -24,4 +23,4 @@ public class JsTestsAsserter() : Asserter {
|
||||
}
|
||||
|
||||
native("JsTests.assert")
|
||||
public fun assert(value: Boolean, message: String): Unit = js.noImpl
|
||||
public fun assert(value: Boolean, message: String): Unit = js.noImpl
|
||||
|
||||
@@ -1,7 +1,5 @@
|
||||
package foo
|
||||
|
||||
import js.*
|
||||
|
||||
native
|
||||
class A(b: Int) {
|
||||
fun g(): Int = js.noImpl
|
||||
@@ -24,4 +22,4 @@ fun box(): Boolean {
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,7 +1,5 @@
|
||||
package foo
|
||||
|
||||
import js.*
|
||||
|
||||
native
|
||||
class A(val c: Int) {
|
||||
native
|
||||
@@ -17,4 +15,4 @@ fun box(): Boolean {
|
||||
if (A(2).c != 2) return false
|
||||
|
||||
return true
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,8 +1,6 @@
|
||||
package foo
|
||||
|
||||
import js.*
|
||||
|
||||
native
|
||||
fun returnFalse(): Boolean = js.noImpl
|
||||
|
||||
fun box() = !returnFalse()
|
||||
fun box() = !returnFalse()
|
||||
|
||||
@@ -1,11 +1,9 @@
|
||||
package foo
|
||||
|
||||
import js.*
|
||||
|
||||
native
|
||||
val c: Any? = js.noImpl
|
||||
|
||||
fun box(): Boolean {
|
||||
if (c != null) return false
|
||||
return (c == null)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,7 +1,5 @@
|
||||
package foo
|
||||
|
||||
import js.*
|
||||
|
||||
/*function g should return 0 if a parameter is undefined 1 if parameter is 1 and 3 if parameter is 3*/
|
||||
native
|
||||
fun f(g: (Int?) -> Int): Boolean = js.noImpl
|
||||
@@ -21,4 +19,4 @@ fun box(): Boolean {
|
||||
}
|
||||
}
|
||||
return f(b)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,7 +1,5 @@
|
||||
package foo
|
||||
|
||||
import js.*
|
||||
|
||||
native
|
||||
fun paramCount(vararg a: Int): Int = js.noImpl
|
||||
|
||||
@@ -118,4 +116,4 @@ fun box(): String {
|
||||
return "failed when combined SureCall and SafeCall, maybe we lost cached expression"
|
||||
|
||||
return "OK"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,8 +1,5 @@
|
||||
package foo
|
||||
|
||||
import js.enumerable
|
||||
import js.native
|
||||
|
||||
native
|
||||
fun <T> _enumerate(o: T): T = noImpl
|
||||
|
||||
@@ -27,4 +24,4 @@ fun box(): Boolean {
|
||||
return (100 == test.a && "s" == test.b) && p.a == 100 && _findFirst<Int>(object {
|
||||
val test = 100
|
||||
}) == 100;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,7 +1,5 @@
|
||||
package foo
|
||||
|
||||
import js.*
|
||||
|
||||
fun box(): Boolean {
|
||||
|
||||
var twoToFive = IntRange(2, 5)
|
||||
|
||||
@@ -1,7 +1,5 @@
|
||||
package foo
|
||||
|
||||
import js.*
|
||||
|
||||
fun box(): Boolean {
|
||||
|
||||
var d = 0
|
||||
|
||||
@@ -1,7 +1,5 @@
|
||||
package foo
|
||||
|
||||
import js.*
|
||||
|
||||
fun box(): Boolean {
|
||||
|
||||
var twoToFive = 2..5
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
package test.browser
|
||||
|
||||
import js.dom.html.document
|
||||
import kotlin.js.dom.html.document
|
||||
import org.w3c.dom.Node
|
||||
|
||||
fun box(): String {
|
||||
@@ -10,4 +10,4 @@ fun box(): String {
|
||||
if (textNode.nodeType != Node.TEXT_NODE) return "The type of the node is ${textNode.nodeType}, ${Node.TEXT_NODE} was expected"
|
||||
if (element.nodeType != Node.ELEMENT_NODE) return "The type of the node is ${element.nodeType}, ${Node.ELEMENT_NODE} was expected"
|
||||
return element.textContent
|
||||
}
|
||||
}
|
||||
|
||||
@@ -4,14 +4,14 @@
|
||||
*/
|
||||
package creatures
|
||||
|
||||
import js.dom.html5.CanvasContext
|
||||
import js.jquery.*
|
||||
import js.dom.html5.CanvasGradient
|
||||
import js.dom.html5.HTMLCanvasElement
|
||||
import java.util.ArrayList
|
||||
import js.dom.html.window
|
||||
import js.dom.html.HTMLElement
|
||||
import js.dom.html.HTMLImageElement
|
||||
import jquery.*
|
||||
import kotlin.js.dom.html.window
|
||||
import kotlin.js.dom.html.HTMLElement
|
||||
import kotlin.js.dom.html.HTMLImageElement
|
||||
import kotlin.js.dom.html5.CanvasContext
|
||||
import kotlin.js.dom.html5.CanvasGradient
|
||||
import kotlin.js.dom.html5.HTMLCanvasElement
|
||||
|
||||
|
||||
fun getImage(path: String): HTMLImageElement {
|
||||
@@ -353,4 +353,4 @@ fun <T> List<T>.reversed(): List<T> {
|
||||
result.add(get(--i))
|
||||
}
|
||||
return result
|
||||
}
|
||||
}
|
||||
|
||||
@@ -6,9 +6,9 @@ Note that only a subset of the api is supported for now.
|
||||
|
||||
package fancylines
|
||||
|
||||
import js.dom.html5.*
|
||||
import js.dom.html.window
|
||||
import js.jquery.*
|
||||
import kotlin.js.dom.html.window
|
||||
import kotlin.js.dom.html5.*
|
||||
import jquery.*
|
||||
|
||||
fun main(args: Array<String>) {
|
||||
jq {
|
||||
|
||||
@@ -3,9 +3,9 @@
|
||||
*/
|
||||
package hello
|
||||
|
||||
import js.dom.html5.*
|
||||
import js.dom.html.window
|
||||
import js.jquery.*
|
||||
import kotlin.js.dom.html.window
|
||||
import kotlin.js.dom.html5.*
|
||||
import jquery.*
|
||||
|
||||
val canvas: HTMLCanvasElement
|
||||
get() {
|
||||
|
||||
@@ -1,13 +1,12 @@
|
||||
package traffic
|
||||
|
||||
import java.util.ArrayList
|
||||
import js.dom.html5.CanvasContext
|
||||
import js.dom.html5.HTMLCanvasElement
|
||||
|
||||
import js.dom.html.HTMLImageElement
|
||||
import js.dom.html.window
|
||||
import js.jquery.*
|
||||
import js.dom.html.HTMLElement
|
||||
import kotlin.js.dom.html5.CanvasContext
|
||||
import kotlin.js.dom.html5.HTMLCanvasElement
|
||||
import kotlin.js.dom.html.HTMLImageElement
|
||||
import kotlin.js.dom.html.window
|
||||
import kotlin.js.dom.html.HTMLElement
|
||||
import jquery.*
|
||||
|
||||
fun getImage(path: String): HTMLImageElement {
|
||||
val image = window.document.createElement("img") as HTMLImageElement
|
||||
|
||||
@@ -26,7 +26,6 @@
|
||||
* Additionally, you can pass the desired initial number of bottles to use (rather than 99)
|
||||
* as a command-line argument
|
||||
*/
|
||||
import js.*
|
||||
|
||||
fun main(args: Array<String>) {
|
||||
if (args.isEmpty()) {
|
||||
|
||||
@@ -5,7 +5,6 @@
|
||||
|
||||
import java.util.*
|
||||
import java.util.Collections.max
|
||||
import js.*;
|
||||
|
||||
/*
|
||||
* A field where cells live. Effectively immutable
|
||||
|
||||
@@ -66,8 +66,6 @@ $imports
|
||||
// See: https://github.com/JetBrains/kotlin/tree/master/libraries/stdlib
|
||||
//
|
||||
|
||||
import js.noImpl
|
||||
|
||||
// Contains stub APIs for the W3C DOM API so we can delegate to the platform DOM instead
|
||||
|
||||
""")
|
||||
@@ -145,7 +143,7 @@ import js.noImpl
|
||||
var counter = 0
|
||||
val parameters = parameterTypes.map{ "arg${++counter}: ${parameterTypeName(it)}" }.makeString(", ")
|
||||
val returnType = simpleTypeName(method.getReturnType())
|
||||
println(" public fun ${method.getName()}($parameters): $returnType = js.noImpl")
|
||||
println(" public fun ${method.getName()}($parameters): $returnType = noImpl")
|
||||
}
|
||||
}
|
||||
val fields = klass.getDeclaredFields().sortBy { it.getName()!! }
|
||||
|
||||
Reference in New Issue
Block a user