[JS IR] Review remarks

- Use intrinsic on this
- Enqueue invoke for DCE
- Change transform
- Ignore instead of target backend

^KT-46204 fixed
This commit is contained in:
Ilya Goncharov
2021-08-09 12:49:06 +03:00
committed by Space
parent 2f0f88062a
commit 766857881a
10 changed files with 63 additions and 57 deletions
@@ -74,7 +74,7 @@ public actual inline fun <T> (suspend () -> T).startCoroutineUninterceptedOrRetu
): Any? {
val a = this.asDynamic()
return if (jsTypeOf(a) == "function") a(completion)
else ::invoke.invokeSuspendSuperType(completion)
else this.invokeSuspendSuperType(completion)
}
/**
@@ -97,7 +97,7 @@ public actual inline fun <R, T> (suspend R.() -> T).startCoroutineUninterceptedO
): Any? {
val a = this.asDynamic()
return if (jsTypeOf(a) == "function") a(receiver, completion)
else ::invoke.invokeSuspendSuperTypeWithReceiver(receiver, completion)
else this.invokeSuspendSuperTypeWithReceiver(receiver, completion)
}
@InlineOnly
@@ -108,7 +108,7 @@ internal actual inline fun <R, P, T> (suspend R.(P) -> T).startCoroutineUninterc
): Any? {
val a = this.asDynamic()
return if (jsTypeOf(a) == "function") a(receiver, param, completion)
else ::invoke.invokeSuspendSuperTypeWithReceiverAndParam(receiver, param, completion)
else this.invokeSuspendSuperTypeWithReceiverAndParam(receiver, param, completion)
}
/**
@@ -134,7 +134,7 @@ public actual fun <T> (suspend () -> T).createCoroutineUnintercepted(
createCoroutineFromSuspendFunction(completion) {
val a = this.asDynamic()
if (jsTypeOf(a) == "function") a(completion)
else ::invoke.invokeSuspendSuperType(completion)
else this.invokeSuspendSuperType(completion)
}
/**
@@ -161,7 +161,7 @@ public actual fun <R, T> (suspend R.() -> T).createCoroutineUnintercepted(
createCoroutineFromSuspendFunction(completion) {
val a = this.asDynamic()
if (jsTypeOf(a) == "function") a(receiver, completion)
else ::invoke.invokeSuspendSuperTypeWithReceiver(receiver, completion)
else this.invokeSuspendSuperTypeWithReceiver(receiver, completion)
}
/**