[stdlib-js] Split core.kt in stdlib-js into few files to simplify using part of it in JS IR BE related tests
This commit is contained in:
@@ -0,0 +1,12 @@
|
|||||||
|
/*
|
||||||
|
* Copyright 2010-2018 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license
|
||||||
|
* that can be found in the license/LICENSE.txt file.
|
||||||
|
*/
|
||||||
|
|
||||||
|
package kotlin.collections
|
||||||
|
|
||||||
|
@kotlin.internal.InlineOnly
|
||||||
|
@Suppress("UNUSED_PARAMETER")
|
||||||
|
internal inline fun deleteProperty(obj: Any, property: Any) {
|
||||||
|
js("delete obj[property]")
|
||||||
|
}
|
||||||
@@ -1,7 +1,9 @@
|
|||||||
package kotlin.js
|
/*
|
||||||
|
* Copyright 2010-2018 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license
|
||||||
|
* that can be found in the license/LICENSE.txt file.
|
||||||
|
*/
|
||||||
|
|
||||||
@Deprecated(message = "Use `definedExternally` instead", level = DeprecationLevel.ERROR, replaceWith = ReplaceWith("definedExternally"))
|
package kotlin.js
|
||||||
public external val noImpl: Nothing
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The property that can be used as a placeholder for statements and values that are defined in JavaScript.
|
* The property that can be used as a placeholder for statements and values that are defined in JavaScript.
|
||||||
@@ -31,25 +33,6 @@ public external val noImpl: Nothing
|
|||||||
*/
|
*/
|
||||||
public external val definedExternally: Nothing
|
public external val definedExternally: Nothing
|
||||||
|
|
||||||
/**
|
|
||||||
* Exposes the JavaScript [eval function](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/eval) to Kotlin.
|
|
||||||
*/
|
|
||||||
public external fun eval(expr: String): dynamic
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Exposes the JavaScript [undefined property](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/undefined) to Kotlin.
|
|
||||||
*/
|
|
||||||
public external val undefined: Nothing?
|
|
||||||
|
|
||||||
@Deprecated("Use toInt() instead.", ReplaceWith("s.toInt()"), level = DeprecationLevel.ERROR)
|
|
||||||
public external fun parseInt(s: String): Int
|
|
||||||
|
|
||||||
@Deprecated("Use toInt(radix) instead.", ReplaceWith("s.toInt(radix)"), level = DeprecationLevel.ERROR)
|
|
||||||
public external fun parseInt(s: String, radix: Int = definedExternally): Int
|
|
||||||
|
|
||||||
@Deprecated("Use toDouble() instead.", ReplaceWith("s.toDouble()"), level = DeprecationLevel.ERROR)
|
|
||||||
public external fun parseFloat(s: String, radix: Int = definedExternally): Double
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Puts the given piece of a JavaScript code right into the calling function.
|
* Puts the given piece of a JavaScript code right into the calling function.
|
||||||
* The compiler replaces call to `js(...)` code with the string constant provided as a parameter.
|
* The compiler replaces call to `js(...)` code with the string constant provided as a parameter.
|
||||||
@@ -68,16 +51,3 @@ public external fun parseFloat(s: String, radix: Int = definedExternally): Doubl
|
|||||||
* including parameters. You can't refer to functions, properties and classes by their short names.
|
* including parameters. You can't refer to functions, properties and classes by their short names.
|
||||||
*/
|
*/
|
||||||
public external fun js(code: String): dynamic
|
public external fun js(code: String): dynamic
|
||||||
|
|
||||||
/**
|
|
||||||
* Function corresponding to JavaScript's `typeof` operator
|
|
||||||
*/
|
|
||||||
@kotlin.internal.InlineOnly
|
|
||||||
@Suppress("UNUSED_PARAMETER")
|
|
||||||
public inline fun jsTypeOf(a: Any?): String = js("typeof a")
|
|
||||||
|
|
||||||
@kotlin.internal.InlineOnly
|
|
||||||
@Suppress("UNUSED_PARAMETER")
|
|
||||||
internal inline fun deleteProperty(obj: Any, property: Any) {
|
|
||||||
js("delete obj[property]")
|
|
||||||
}
|
|
||||||
@@ -0,0 +1,18 @@
|
|||||||
|
/*
|
||||||
|
* Copyright 2010-2018 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license
|
||||||
|
* that can be found in the license/LICENSE.txt file.
|
||||||
|
*/
|
||||||
|
|
||||||
|
package kotlin.js
|
||||||
|
|
||||||
|
@Deprecated(message = "Use `definedExternally` instead", level = DeprecationLevel.ERROR, replaceWith = ReplaceWith("definedExternally"))
|
||||||
|
public external val noImpl: Nothing
|
||||||
|
|
||||||
|
@Deprecated("Use toInt() instead.", ReplaceWith("s.toInt()"), level = DeprecationLevel.ERROR)
|
||||||
|
public external fun parseInt(s: String): Int
|
||||||
|
|
||||||
|
@Deprecated("Use toInt(radix) instead.", ReplaceWith("s.toInt(radix)"), level = DeprecationLevel.ERROR)
|
||||||
|
public external fun parseInt(s: String, radix: Int = definedExternally): Int
|
||||||
|
|
||||||
|
@Deprecated("Use toDouble() instead.", ReplaceWith("s.toDouble()"), level = DeprecationLevel.ERROR)
|
||||||
|
public external fun parseFloat(s: String, radix: Int = definedExternally): Double
|
||||||
@@ -0,0 +1,16 @@
|
|||||||
|
/*
|
||||||
|
* Copyright 2010-2018 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license
|
||||||
|
* that can be found in the license/LICENSE.txt file.
|
||||||
|
*/
|
||||||
|
|
||||||
|
package kotlin.js
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Exposes the JavaScript [undefined property](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/undefined) to Kotlin.
|
||||||
|
*/
|
||||||
|
public external val undefined: Nothing?
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Exposes the JavaScript [eval function](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/eval) to Kotlin.
|
||||||
|
*/
|
||||||
|
public external fun eval(expr: String): dynamic
|
||||||
@@ -0,0 +1,13 @@
|
|||||||
|
/*
|
||||||
|
* Copyright 2010-2018 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license
|
||||||
|
* that can be found in the license/LICENSE.txt file.
|
||||||
|
*/
|
||||||
|
|
||||||
|
package kotlin.js
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Function corresponding to JavaScript's `typeof` operator
|
||||||
|
*/
|
||||||
|
@kotlin.internal.InlineOnly
|
||||||
|
@Suppress("UNUSED_PARAMETER")
|
||||||
|
public inline fun jsTypeOf(a: Any?): String = js("typeof a")
|
||||||
Reference in New Issue
Block a user