[JS IR] Introduce jsArguments() intrinsic function

`jsArguments()` is lowered into a reference of the `arguments` object.

This is useful for extracting varargs, when calling Kotlin code from
JavaScript. For a concrete example, see KT-15223.
This commit is contained in:
Sergej Jaskiewicz
2021-12-22 19:01:42 +03:00
committed by Space
parent d8838f4e7b
commit 08e6116ecb
4 changed files with 12 additions and 3 deletions
@@ -195,6 +195,9 @@ internal fun <A> slice(a: A): A
@JsIntrinsic
internal fun unreachable(): Nothing
@JsIntrinsic
internal fun jsArguments(): Any?
@JsIntrinsic
@Suppress("REIFIED_TYPE_PARAMETER_NO_INLINE") // TODO: mark `inline` and skip in inliner
internal fun <reified T : Any> jsClassIntrinsic(): JsClass<T>
@@ -204,4 +207,4 @@ internal fun <reified T : Any> jsClassIntrinsic(): JsClass<T>
internal fun jsInIntrinsic(lhs: Any?, rhs: Any): Boolean
@JsIntrinsic
internal fun jsDelete(e: Any?)
internal fun jsDelete(e: Any?)