[JS] Support typeOf
This commit is contained in:
@@ -465,6 +465,7 @@ enum SpecialFunction {
|
||||
COROUTINE_RECEIVER = 8;
|
||||
SET_COROUTINE_RESULT = 9;
|
||||
GET_KCLASS = 10;
|
||||
GET_REIFIED_TYPE_PARAMETER_KTYPE = 11;
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -558,6 +558,7 @@ class JsAstDeserializer(program: JsProgram, private val sourceRoots: Iterable<Fi
|
||||
JsAstProtoBuf.SpecialFunction.COROUTINE_RECEIVER -> SpecialFunction.COROUTINE_RECEIVER
|
||||
JsAstProtoBuf.SpecialFunction.SET_COROUTINE_RESULT -> SpecialFunction.SET_COROUTINE_RESULT
|
||||
JsAstProtoBuf.SpecialFunction.GET_KCLASS -> SpecialFunction.GET_KCLASS
|
||||
JsAstProtoBuf.SpecialFunction.GET_REIFIED_TYPE_PARAMETER_KTYPE -> SpecialFunction.GET_REIFIED_TYPE_PARAMETER_KTYPE
|
||||
}
|
||||
|
||||
private fun <T : JsNode> withLocation(fileId: Int?, location: Location?, action: () -> T): T {
|
||||
|
||||
@@ -183,6 +183,10 @@ public final class JsAstProtoBuf {
|
||||
* <code>GET_KCLASS = 10;</code>
|
||||
*/
|
||||
GET_KCLASS(9, 10),
|
||||
/**
|
||||
* <code>GET_REIFIED_TYPE_PARAMETER_KTYPE = 11;</code>
|
||||
*/
|
||||
GET_REIFIED_TYPE_PARAMETER_KTYPE(10, 11),
|
||||
;
|
||||
|
||||
/**
|
||||
@@ -225,6 +229,10 @@ public final class JsAstProtoBuf {
|
||||
* <code>GET_KCLASS = 10;</code>
|
||||
*/
|
||||
public static final int GET_KCLASS_VALUE = 10;
|
||||
/**
|
||||
* <code>GET_REIFIED_TYPE_PARAMETER_KTYPE = 11;</code>
|
||||
*/
|
||||
public static final int GET_REIFIED_TYPE_PARAMETER_KTYPE_VALUE = 11;
|
||||
|
||||
|
||||
public final int getNumber() { return value; }
|
||||
@@ -241,6 +249,7 @@ public final class JsAstProtoBuf {
|
||||
case 8: return COROUTINE_RECEIVER;
|
||||
case 9: return SET_COROUTINE_RESULT;
|
||||
case 10: return GET_KCLASS;
|
||||
case 11: return GET_REIFIED_TYPE_PARAMETER_KTYPE;
|
||||
default: return null;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -601,6 +601,7 @@ class JsAstSerializer(private val jsAstValidator: ((JsProgramFragment, Set<JsNam
|
||||
SpecialFunction.COROUTINE_RECEIVER -> JsAstProtoBuf.SpecialFunction.COROUTINE_RECEIVER
|
||||
SpecialFunction.SET_COROUTINE_RESULT -> JsAstProtoBuf.SpecialFunction.SET_COROUTINE_RESULT
|
||||
SpecialFunction.GET_KCLASS -> JsAstProtoBuf.SpecialFunction.GET_KCLASS
|
||||
SpecialFunction.GET_REIFIED_TYPE_PARAMETER_KTYPE -> JsAstProtoBuf.SpecialFunction.GET_REIFIED_TYPE_PARAMETER_KTYPE
|
||||
}
|
||||
|
||||
private fun serialize(name: JsName): Int = nameMap.getOrPut(name) {
|
||||
|
||||
Reference in New Issue
Block a user