KJS: remove obsolete classIndex
This commit is contained in:
@@ -121,8 +121,6 @@ class CoroutineFunctionTransformer(private val program: JsProgram, private val f
|
||||
val metadataObject = JsObjectLiteral(true)
|
||||
metadataObject.propertyInitializers += JsPropertyInitializer(
|
||||
JsNameRef("type"), JsNameRef("CLASS", JsNameRef("TYPE", Namer.KOTLIN_NAME)))
|
||||
metadataObject.propertyInitializers += JsPropertyInitializer(
|
||||
JsNameRef("classIndex"), JsInvocation(JsNameRef("newClassIndex", Namer.KOTLIN_NAME)))
|
||||
metadataObject.propertyInitializers += JsPropertyInitializer(JsNameRef("simpleName"), JsLiteral.NULL)
|
||||
metadataObject.propertyInitializers += JsPropertyInitializer(JsNameRef("baseClasses"), JsArrayLiteral(listOf(baseClassRefRef)))
|
||||
|
||||
|
||||
@@ -133,7 +133,6 @@ function getPropertyRefMetadata(cache) {
|
||||
cache.value = {
|
||||
baseClasses: [cache.implementedInterface()],
|
||||
baseClass: null,
|
||||
classIndex: Kotlin.newClassIndex(),
|
||||
functions: {},
|
||||
properties: {},
|
||||
types: {},
|
||||
|
||||
@@ -20,13 +20,6 @@ Kotlin.TYPE = {
|
||||
OBJECT: "object"
|
||||
};
|
||||
|
||||
Kotlin.classCount = 0;
|
||||
Kotlin.newClassIndex = function () {
|
||||
var tmp = Kotlin.classCount;
|
||||
Kotlin.classCount++;
|
||||
return tmp;
|
||||
};
|
||||
|
||||
Kotlin.callGetter = function (thisObject, klass, propertyName) {
|
||||
var propertyDescriptor = Object.getOwnPropertyDescriptor(klass, propertyName);
|
||||
if (propertyDescriptor != null) {
|
||||
@@ -60,10 +53,6 @@ Kotlin.callSetter = function (thisObject, klass, propertyName, value) {
|
||||
};
|
||||
|
||||
function isInheritanceFromInterface(metadata, iface) {
|
||||
// TODO: return this optimization
|
||||
/*if (metadata == null || metadata.classIndex < iface.$metadata$.classIndex) {
|
||||
return false;
|
||||
}*/
|
||||
var baseClasses = metadata.baseClasses;
|
||||
var i;
|
||||
for (i = 0; i < baseClasses.length; i++) {
|
||||
|
||||
@@ -177,10 +177,8 @@ class ClassTranslator private constructor(
|
||||
DescriptorUtils.isObject(descriptor) -> JsNameRef("OBJECT", kotlinType)
|
||||
else -> JsNameRef("CLASS", kotlinType)
|
||||
}
|
||||
val typeIndex = JsInvocation(JsNameRef("newClassIndex", Namer.KOTLIN_NAME))
|
||||
|
||||
metadataLiteral.propertyInitializers += JsPropertyInitializer(JsNameRef("type"), typeRef)
|
||||
metadataLiteral.propertyInitializers += JsPropertyInitializer(JsNameRef("classIndex"), typeIndex)
|
||||
|
||||
val simpleName = descriptor.name
|
||||
if (!simpleName.isSpecial) {
|
||||
|
||||
Reference in New Issue
Block a user