-
Notifications
You must be signed in to change notification settings - Fork 73
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Rename moduleId onto more sense "playground" #777
Merged
Merged
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
src/test/resources/test-compile-output/js/KotlinByExampleSnippetsTests/01_dynamic/0.json
Large diffs are not rendered by default.
Oops, something went wrong.
2 changes: 1 addition & 1 deletion
2
src/test/resources/test-compile-output/js/KotlinByExampleSnippetsTests/02_js_function/0.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 (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 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 tmp0_elvis_lhs = i.prototype.$imask$;\n var imask = tmp0_elvis_lhs == null ? i.$imask$ : tmp0_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.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 defineProp(obj, name, getter, setter) {\n return Object.defineProperty(obj, name, {configurable: true, get: getter, set: setter});\n }\n function objectCreate(proto) {\n proto = proto === VOID ? null : proto;\n return Object.create(proto);\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 Unit() {\n }\n var Unit_instance;\n function Unit_getInstance() {\n return Unit_instance;\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":""} | ||
{"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.playground = factory(typeof playground === 'undefined' ? {} : playground);\n}(function (_) {\n 'use strict';\n //region block: pre-declaration\n initMetadataForObject(Unit, 'Unit');\n //endregion\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 tmp0_elvis_lhs = i.prototype.$imask$;\n var imask = tmp0_elvis_lhs == null ? i.$imask$ : tmp0_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.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 defineProp(obj, name, getter, setter) {\n return Object.defineProperty(obj, name, {configurable: true, get: getter, set: setter});\n }\n function objectCreate(proto) {\n proto = proto === VOID ? null : proto;\n return Object.create(proto);\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 Unit() {\n }\n var Unit_instance;\n function Unit_getInstance() {\n return Unit_instance;\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}));\nplayground.output?.buffer_1;\n\n","exception":null,"errors":{"File.kt":[]},"text":""} | ||
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The only change is renaming
moduleId
->playground