Skip to content

Commit 0089ea2

Browse files
committed
test: KTL-1605: fix deprecate warning text in js output
1 parent f62f8fe commit 0089ea2

16 files changed

+16
-16
lines changed

src/test/resources/test-compile-output/js/KotlinByExampleSnippetsTests/01_dynamic/0.json

+1-1
Large diffs are not rendered by default.
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
{"jsCode":"//region block: polyfills\n(function () {\n if (typeof globalThis === 'object')\n return;\n Object.defineProperty(Object.prototype, '__magic__', {get: function () {\n return this;\n }, configurable: true});\n __magic__.globalThis = __magic__;\n delete Object.prototype.__magic__;\n}());\n//endregion\n(function (root, factory) {\n if (typeof define === 'function' && define.amd)\n define(['exports'], factory);\n else if (typeof exports === 'object')\n factory(module.exports);\n else\n root.moduleId = factory(typeof moduleId === 'undefined' ? {} : moduleId);\n}(globalThis, function (_) {\n 'use strict';\n //region block: pre-declaration\n initMetadataForObject(Unit, 'Unit');\n //endregion\n function Unit() {\n }\n var Unit_instance;\n function Unit_getInstance() {\n return Unit_instance;\n }\n function implement(interfaces) {\n var maxSize = 1;\n var masks = [];\n var inductionVariable = 0;\n var last = interfaces.length;\n while (inductionVariable < last) {\n var i = interfaces[inductionVariable];\n inductionVariable = inductionVariable + 1 | 0;\n var currentSize = maxSize;\n var tmp1_elvis_lhs = i.prototype.$imask$;\n var imask = tmp1_elvis_lhs == null ? i.$imask$ : tmp1_elvis_lhs;\n if (!(imask == null)) {\n masks.push(imask);\n currentSize = imask.length;\n }\n var iid = i.$metadata$.iid;\n var tmp;\n if (iid == null) {\n tmp = null;\n } else {\n // Inline function 'kotlin.let' call\n // Inline function 'kotlin.contracts.contract' call\n // Inline function 'kotlin.js.implement.<anonymous>' call\n tmp = bitMaskWith(iid);\n }\n var iidImask = tmp;\n if (!(iidImask == null)) {\n masks.push(iidImask);\n currentSize = Math.max(currentSize, iidImask.length);\n }\n if (currentSize > maxSize) {\n maxSize = currentSize;\n }\n }\n return compositeBitMask(maxSize, masks);\n }\n function bitMaskWith(activeBit) {\n var numberIndex = activeBit >> 5;\n var intArray = new Int32Array(numberIndex + 1 | 0);\n var positionInNumber = activeBit & 31;\n var numberWithSettledBit = 1 << positionInNumber;\n intArray[numberIndex] = intArray[numberIndex] | numberWithSettledBit;\n return intArray;\n }\n function compositeBitMask(capacity, masks) {\n var tmp = 0;\n var tmp_0 = new Int32Array(capacity);\n while (tmp < capacity) {\n var tmp_1 = tmp;\n var result = 0;\n var inductionVariable = 0;\n var last = masks.length;\n while (inductionVariable < last) {\n var mask = masks[inductionVariable];\n inductionVariable = inductionVariable + 1 | 0;\n if (tmp_1 < mask.length) {\n result = result | mask[tmp_1];\n }\n }\n tmp_0[tmp_1] = result;\n tmp = tmp + 1 | 0;\n }\n return tmp_0;\n }\n function objectCreate(proto) {\n proto = proto === VOID ? null : proto;\n return Object.create(proto);\n }\n function defineProp(obj, name, getter, setter) {\n return Object.defineProperty(obj, name, {configurable: true, get: getter, set: setter});\n }\n function equals(obj1, obj2) {\n if (obj1 == null) {\n return obj2 == null;\n }\n if (obj2 == null) {\n return false;\n }\n if (typeof obj1 === 'object' && typeof obj1.equals === 'function') {\n return obj1.equals(obj2);\n }\n if (obj1 !== obj1) {\n return obj2 !== obj2;\n }\n if (typeof obj1 === 'number' && typeof obj2 === 'number') {\n var tmp;\n if (obj1 === obj2) {\n var tmp_0;\n if (obj1 !== 0) {\n tmp_0 = true;\n } else {\n // Inline function 'kotlin.js.asDynamic' call\n var tmp_1 = 1 / obj1;\n // Inline function 'kotlin.js.asDynamic' call\n tmp_0 = tmp_1 === 1 / obj2;\n }\n tmp = tmp_0;\n } else {\n tmp = false;\n }\n return tmp;\n }\n return obj1 === obj2;\n }\n function protoOf(constructor) {\n return constructor.prototype;\n }\n function createMetadata(kind, name, defaultConstructor, associatedObjectKey, associatedObjects, suspendArity) {\n var undef = VOID;\n var iid = kind === 'interface' ? generateInterfaceId() : VOID;\n return {kind: kind, simpleName: name, associatedObjectKey: associatedObjectKey, associatedObjects: associatedObjects, suspendArity: suspendArity, $kClass$: undef, defaultConstructor: defaultConstructor, iid: iid};\n }\n function generateInterfaceId() {\n if (globalInterfaceId === VOID) {\n globalInterfaceId = 0;\n }\n // Inline function 'kotlin.js.unsafeCast' call\n globalInterfaceId = globalInterfaceId + 1 | 0;\n // Inline function 'kotlin.js.unsafeCast' call\n return globalInterfaceId;\n }\n var globalInterfaceId;\n function initMetadataFor(kind, ctor, name, defaultConstructor, parent, interfaces, suspendArity, associatedObjectKey, associatedObjects) {\n if (!(parent == null)) {\n ctor.prototype = Object.create(parent.prototype);\n ctor.prototype.constructor = ctor;\n }\n var metadata = createMetadata(kind, name, defaultConstructor, associatedObjectKey, associatedObjects, suspendArity);\n ctor.$metadata$ = metadata;\n if (!(interfaces == null)) {\n var receiver = !equals(metadata.iid, VOID) ? ctor : ctor.prototype;\n receiver.$imask$ = implement(interfaces);\n }\n }\n function initMetadataForObject(ctor, name, defaultConstructor, parent, interfaces, suspendArity, associatedObjectKey, associatedObjects) {\n var kind = 'object';\n initMetadataFor(kind, ctor, name, defaultConstructor, parent, interfaces, suspendArity, associatedObjectKey, associatedObjects);\n }\n function initMetadataForCompanion(ctor, parent, interfaces, suspendArity) {\n initMetadataForObject(ctor, 'Companion', VOID, parent, interfaces, suspendArity, VOID, VOID);\n }\n function get_VOID() {\n _init_properties_void_kt__3zg9as();\n return VOID;\n }\n var VOID;\n var properties_initialized_void_kt_e4ret2;\n function _init_properties_void_kt__3zg9as() {\n if (!properties_initialized_void_kt_e4ret2) {\n properties_initialized_void_kt_e4ret2 = true;\n VOID = void 0;\n }\n }\n function main() {\n alert('alert from Kotlin!');\n }\n function mainWrapper() {\n main();\n }\n //region block: init\n Unit_instance = new Unit();\n //endregion\nif (typeof get_output !== \"undefined\") {\n get_output();\n output = new BufferedOutput();\n _.output = get_output();\n}\n mainWrapper();\n return _;\n}));\nmoduleId.output?.buffer_1;\n\n","exception":null,"errors":{"File.kt":[]},"text":""}
1+
{"jsCode":"//region block: polyfills\n(function () {\n if (typeof globalThis === 'object')\n return;\n Object.defineProperty(Object.prototype, '__magic__', {get: function () {\n return this;\n }, configurable: true});\n __magic__.globalThis = __magic__;\n delete Object.prototype.__magic__;\n}());\n//endregion\n(function (factory) {\n if (typeof define === 'function' && define.amd)\n define(['exports'], factory);\n else if (typeof exports === 'object')\n factory(module.exports);\n else\n globalThis.moduleId = factory(typeof moduleId === 'undefined' ? {} : moduleId);\n}(function (_) {\n 'use strict';\n //region block: pre-declaration\n initMetadataForObject(Unit, 'Unit');\n //endregion\n function Unit() {\n }\n var Unit_instance;\n function Unit_getInstance() {\n return Unit_instance;\n }\n function implement(interfaces) {\n var maxSize = 1;\n var masks = [];\n var inductionVariable = 0;\n var last = interfaces.length;\n while (inductionVariable < last) {\n var i = interfaces[inductionVariable];\n inductionVariable = inductionVariable + 1 | 0;\n var currentSize = maxSize;\n var tmp1_elvis_lhs = i.prototype.$imask$;\n var imask = tmp1_elvis_lhs == null ? i.$imask$ : tmp1_elvis_lhs;\n if (!(imask == null)) {\n masks.push(imask);\n currentSize = imask.length;\n }\n var iid = i.$metadata$.iid;\n var tmp;\n if (iid == null) {\n tmp = null;\n } else {\n // Inline function 'kotlin.let' call\n // Inline function 'kotlin.contracts.contract' call\n // Inline function 'kotlin.js.implement.<anonymous>' call\n tmp = bitMaskWith(iid);\n }\n var iidImask = tmp;\n if (!(iidImask == null)) {\n masks.push(iidImask);\n currentSize = Math.max(currentSize, iidImask.length);\n }\n if (currentSize > maxSize) {\n maxSize = currentSize;\n }\n }\n return compositeBitMask(maxSize, masks);\n }\n function bitMaskWith(activeBit) {\n var numberIndex = activeBit >> 5;\n var intArray = new Int32Array(numberIndex + 1 | 0);\n var positionInNumber = activeBit & 31;\n var numberWithSettledBit = 1 << positionInNumber;\n intArray[numberIndex] = intArray[numberIndex] | numberWithSettledBit;\n return intArray;\n }\n function compositeBitMask(capacity, masks) {\n var tmp = 0;\n var tmp_0 = new Int32Array(capacity);\n while (tmp < capacity) {\n var tmp_1 = tmp;\n var result = 0;\n var inductionVariable = 0;\n var last = masks.length;\n while (inductionVariable < last) {\n var mask = masks[inductionVariable];\n inductionVariable = inductionVariable + 1 | 0;\n if (tmp_1 < mask.length) {\n result = result | mask[tmp_1];\n }\n }\n tmp_0[tmp_1] = result;\n tmp = tmp + 1 | 0;\n }\n return tmp_0;\n }\n function objectCreate(proto) {\n proto = proto === VOID ? null : proto;\n return Object.create(proto);\n }\n function defineProp(obj, name, getter, setter) {\n return Object.defineProperty(obj, name, {configurable: true, get: getter, set: setter});\n }\n function equals(obj1, obj2) {\n if (obj1 == null) {\n return obj2 == null;\n }\n if (obj2 == null) {\n return false;\n }\n if (typeof obj1 === 'object' && typeof obj1.equals === 'function') {\n return obj1.equals(obj2);\n }\n if (obj1 !== obj1) {\n return obj2 !== obj2;\n }\n if (typeof obj1 === 'number' && typeof obj2 === 'number') {\n var tmp;\n if (obj1 === obj2) {\n var tmp_0;\n if (obj1 !== 0) {\n tmp_0 = true;\n } else {\n // Inline function 'kotlin.js.asDynamic' call\n var tmp_1 = 1 / obj1;\n // Inline function 'kotlin.js.asDynamic' call\n tmp_0 = tmp_1 === 1 / obj2;\n }\n tmp = tmp_0;\n } else {\n tmp = false;\n }\n return tmp;\n }\n return obj1 === obj2;\n }\n function protoOf(constructor) {\n return constructor.prototype;\n }\n function createMetadata(kind, name, defaultConstructor, associatedObjectKey, associatedObjects, suspendArity) {\n var undef = VOID;\n var iid = kind === 'interface' ? generateInterfaceId() : VOID;\n return {kind: kind, simpleName: name, associatedObjectKey: associatedObjectKey, associatedObjects: associatedObjects, suspendArity: suspendArity, $kClass$: undef, defaultConstructor: defaultConstructor, iid: iid};\n }\n function generateInterfaceId() {\n if (globalInterfaceId === VOID) {\n globalInterfaceId = 0;\n }\n // Inline function 'kotlin.js.unsafeCast' call\n globalInterfaceId = globalInterfaceId + 1 | 0;\n // Inline function 'kotlin.js.unsafeCast' call\n return globalInterfaceId;\n }\n var globalInterfaceId;\n function initMetadataFor(kind, ctor, name, defaultConstructor, parent, interfaces, suspendArity, associatedObjectKey, associatedObjects) {\n if (!(parent == null)) {\n ctor.prototype = Object.create(parent.prototype);\n ctor.prototype.constructor = ctor;\n }\n var metadata = createMetadata(kind, name, defaultConstructor, associatedObjectKey, associatedObjects, suspendArity);\n ctor.$metadata$ = metadata;\n if (!(interfaces == null)) {\n var receiver = !equals(metadata.iid, VOID) ? ctor : ctor.prototype;\n receiver.$imask$ = implement(interfaces);\n }\n }\n function initMetadataForObject(ctor, name, defaultConstructor, parent, interfaces, suspendArity, associatedObjectKey, associatedObjects) {\n var kind = 'object';\n initMetadataFor(kind, ctor, name, defaultConstructor, parent, interfaces, suspendArity, associatedObjectKey, associatedObjects);\n }\n function initMetadataForCompanion(ctor, parent, interfaces, suspendArity) {\n initMetadataForObject(ctor, 'Companion', VOID, parent, interfaces, suspendArity, VOID, VOID);\n }\n function get_VOID() {\n _init_properties_void_kt__3zg9as();\n return VOID;\n }\n var VOID;\n var properties_initialized_void_kt_e4ret2;\n function _init_properties_void_kt__3zg9as() {\n if (!properties_initialized_void_kt_e4ret2) {\n properties_initialized_void_kt_e4ret2 = true;\n VOID = void 0;\n }\n }\n function main() {\n alert('alert from Kotlin!');\n }\n function mainWrapper() {\n main();\n }\n //region block: init\n Unit_instance = new Unit();\n //endregion\nif (typeof get_output !== \"undefined\") {\n get_output();\n output = new BufferedOutput();\n _.output = get_output();\n}\n mainWrapper();\n return _;\n}));\nmoduleId.output?.buffer_1;\n\n","exception":null,"errors":{"File.kt":[]},"text":""}

0 commit comments

Comments
 (0)