diff --git a/dist/kotlin-kotlin-stdlib.js b/dist/kotlin-kotlin-stdlib.js index 93d8221..50a2200 100644 --- a/dist/kotlin-kotlin-stdlib.js +++ b/dist/kotlin-kotlin-stdlib.js @@ -57,6 +57,12 @@ if (typeof Math.clz32 === 'undefined') { }; }(Math.log, Math.LN2); } +if (typeof String.prototype.startsWith === 'undefined') { + Object.defineProperty(String.prototype, 'startsWith', {value: function (searchString, position) { + position = position || 0; + return this.lastIndexOf(searchString, position) === position; + }}); +} if (typeof String.prototype.endsWith === 'undefined') { Object.defineProperty(String.prototype, 'endsWith', {value: function (searchString, position) { var subjectString = this.toString(); @@ -68,12 +74,6 @@ if (typeof String.prototype.endsWith === 'undefined') { return lastIndex !== -1 && lastIndex === position; }}); } -if (typeof String.prototype.startsWith === 'undefined') { - Object.defineProperty(String.prototype, 'startsWith', {value: function (searchString, position) { - position = position || 0; - return this.lastIndexOf(searchString, position) === position; - }}); -} //endregion (function (factory) { if (typeof define === 'function' && define.amd) @@ -117,22 +117,22 @@ if (typeof String.prototype.startsWith === 'undefined') { initMetadataForClass(AbstractCollection, 'AbstractCollection', VOID, VOID, [Collection]); initMetadataForClass(AbstractMutableCollection, 'AbstractMutableCollection', VOID, AbstractCollection, [AbstractCollection, Collection]); initMetadataForClass(IteratorImpl, 'IteratorImpl'); - initMetadataForClass(AbstractMutableList, 'AbstractMutableList', VOID, AbstractMutableCollection, [AbstractMutableCollection, Collection, KtList]); + initMetadataForClass(AbstractMutableList, 'AbstractMutableList', VOID, AbstractMutableCollection, [AbstractMutableCollection, KtList, Collection]); initMetadataForClass(AbstractMap, 'AbstractMap', VOID, VOID, [KtMap]); initMetadataForClass(AbstractMutableMap, 'AbstractMutableMap', VOID, AbstractMap, [AbstractMap, KtMap]); - initMetadataForClass(AbstractMutableSet, 'AbstractMutableSet', VOID, AbstractMutableCollection, [AbstractMutableCollection, Collection, KtSet]); + initMetadataForClass(AbstractMutableSet, 'AbstractMutableSet', VOID, AbstractMutableCollection, [AbstractMutableCollection, KtSet, Collection]); initMetadataForCompanion(Companion_2); - initMetadataForClass(ArrayList, 'ArrayList', ArrayList_init_$Create$, AbstractMutableList, [AbstractMutableList, Collection, KtList]); + initMetadataForClass(ArrayList, 'ArrayList', ArrayList_init_$Create$, AbstractMutableList, [AbstractMutableList, KtList, Collection]); initMetadataForClass(HashMap, 'HashMap', HashMap_init_$Create$, AbstractMutableMap, [AbstractMutableMap, KtMap]); - initMetadataForClass(HashMapKeys, 'HashMapKeys', VOID, AbstractMutableSet, [Collection, KtSet, AbstractMutableSet]); + initMetadataForClass(HashMapKeys, 'HashMapKeys', VOID, AbstractMutableSet, [KtSet, Collection, AbstractMutableSet]); initMetadataForClass(HashMapValues, 'HashMapValues', VOID, AbstractMutableCollection, [Collection, AbstractMutableCollection]); - initMetadataForClass(HashMapEntrySetBase, 'HashMapEntrySetBase', VOID, AbstractMutableSet, [Collection, KtSet, AbstractMutableSet]); + initMetadataForClass(HashMapEntrySetBase, 'HashMapEntrySetBase', VOID, AbstractMutableSet, [KtSet, Collection, AbstractMutableSet]); initMetadataForClass(HashMapEntrySet, 'HashMapEntrySet', VOID, HashMapEntrySetBase); initMetadataForClass(HashMapKeysDefault$iterator$1); initMetadataForClass(HashMapKeysDefault, 'HashMapKeysDefault', VOID, AbstractMutableSet); initMetadataForClass(HashMapValuesDefault$iterator$1); initMetadataForClass(HashMapValuesDefault, 'HashMapValuesDefault', VOID, AbstractMutableCollection); - initMetadataForClass(HashSet, 'HashSet', HashSet_init_$Create$, AbstractMutableSet, [AbstractMutableSet, Collection, KtSet]); + initMetadataForClass(HashSet, 'HashSet', HashSet_init_$Create$, AbstractMutableSet, [AbstractMutableSet, KtSet, Collection]); initMetadataForCompanion(Companion_3); initMetadataForClass(Itr, 'Itr'); initMetadataForClass(KeysItr, 'KeysItr', VOID, Itr); @@ -178,7 +178,7 @@ if (typeof String.prototype.startsWith === 'undefined') { initMetadataForClass(InternalHashMap, 'InternalHashMap', InternalHashMap_init_$Create$, VOID, [InternalMap]); initMetadataForObject(EmptyHolder, 'EmptyHolder'); initMetadataForClass(LinkedHashMap, 'LinkedHashMap', LinkedHashMap_init_$Create$, HashMap, [HashMap, KtMap]); - initMetadataForClass(LinkedHashSet, 'LinkedHashSet', LinkedHashSet_init_$Create$, HashSet, [HashSet, Collection, KtSet]); + initMetadataForClass(LinkedHashSet, 'LinkedHashSet', LinkedHashSet_init_$Create$, HashSet, [HashSet, KtSet, Collection]); initMetadataForClass(BaseOutput, 'BaseOutput'); initMetadataForClass(NodeJsOutput, 'NodeJsOutput', VOID, BaseOutput); initMetadataForClass(BufferedOutput, 'BufferedOutput', BufferedOutput, BaseOutput); diff --git a/dist/ver-nodejs-app.js b/dist/ver-nodejs-app.js index 422cc39..f796a6c 100644 --- a/dist/ver-nodejs-app.js +++ b/dist/ver-nodejs-app.js @@ -1172,7 +1172,10 @@ return 'false'; } if (type === 'Double') { - return '0'; + return '0.0'; + } + if (type === 'Float') { + return '0f'; } if (type === 'Int') { return '0'; @@ -1217,6 +1220,9 @@ if (type === 'Double') { return 'Double'; } + if (type === 'Float') { + return 'Float'; + } if (type === 'Long') { return 'Long'; } diff --git a/klin/ver-nodejs/app/src/commonMain/kotlin/org/opengamestudio/genKotlin.kt b/klin/ver-nodejs/app/src/commonMain/kotlin/org/opengamestudio/genKotlin.kt index 9e6e73a..e455620 100644 --- a/klin/ver-nodejs/app/src/commonMain/kotlin/org/opengamestudio/genKotlin.kt +++ b/klin/ver-nodejs/app/src/commonMain/kotlin/org/opengamestudio/genKotlin.kt @@ -94,9 +94,13 @@ fun genKotlinFieldDefault(type: String): String { if (type == "Bool") { return "false" } - // `Double` -> `0` + // `Double` -> `0.0` if (type == "Double") { - return "0" + return "0.0" + } + // `Float` -> `0f` + if (type == "Float") { + return "0f" } // `Int` -> `0` if (type == "Int") { @@ -160,6 +164,10 @@ fun genKotlinFieldType(type: String): String { if (type == "Double") { return "Double" } + // `Float` -> `Float` + if (type == "Float") { + return "Float" + } // `Long` -> `Long` if (type == "Long") { return "Long"