JS: drop support of old library format
This commit is contained in:
@@ -0,0 +1,44 @@
|
||||
if (typeof kotlin === 'undefined') {
|
||||
throw new Error("Error loading module 'LibraryExample'. Its dependency 'kotlin' was not found. Please, check whether 'kotlin' is loaded prior to 'LibraryExample'.");
|
||||
}
|
||||
var LibraryExample = function (_, Kotlin) {
|
||||
'use strict';
|
||||
function pairAdd(p) {
|
||||
return p.first + p.second | 0;
|
||||
}
|
||||
function pairMul(p) {
|
||||
return Kotlin.imul(p.first, p.second);
|
||||
}
|
||||
function IntHolder(value) {
|
||||
this.value = value;
|
||||
}
|
||||
IntHolder.$metadata$ = {
|
||||
kind: Kotlin.Kind.CLASS,
|
||||
simpleName: 'IntHolder',
|
||||
interfaces: []
|
||||
};
|
||||
IntHolder.prototype.component1 = function () {
|
||||
return this.value;
|
||||
};
|
||||
IntHolder.prototype.copy_za3lpa$ = function (value) {
|
||||
return new IntHolder(value === void 0 ? this.value : value);
|
||||
};
|
||||
IntHolder.prototype.toString = function () {
|
||||
return 'IntHolder(value=' + Kotlin.toString(this.value) + ')';
|
||||
};
|
||||
IntHolder.prototype.hashCode = function () {
|
||||
var result = 0;
|
||||
result = result * 31 + Kotlin.hashCode(this.value) | 0;
|
||||
return result;
|
||||
};
|
||||
IntHolder.prototype.equals = function (other) {
|
||||
return this === other || (other !== null && (typeof other === 'object' && (Object.getPrototypeOf(this) === Object.getPrototypeOf(other) && Kotlin.equals(this.value, other.value))));
|
||||
};
|
||||
var package$library = _.library || (_.library = {});
|
||||
var package$sample = package$library.sample || (package$library.sample = {});
|
||||
package$sample.pairAdd_1fzo63$ = pairAdd;
|
||||
package$sample.pairMul_1fzo63$ = pairMul;
|
||||
package$sample.IntHolder = IntHolder;
|
||||
Kotlin.defineModule('LibraryExample', _);
|
||||
return _;
|
||||
}(typeof LibraryExample === 'undefined' ? {} : LibraryExample, kotlin);
|
||||
@@ -0,0 +1 @@
|
||||
// Kotlin.kotlin_module_metadata(1, "LibraryExample", "H4sIAAAAAAAAAJV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79MdnbFzMkMbEJ8LnyIQeCzJK6g1U/wOSAB0W3QkAAA==");
|
||||
BIN
Binary file not shown.
BIN
Binary file not shown.
@@ -0,0 +1,8 @@
|
||||
package library.sample
|
||||
|
||||
public fun pairAdd(p: Pair<Int, Int>): Int = p.first + p.second
|
||||
|
||||
public fun pairMul(p: Pair<Int, Int>): Int = p.first * p.second
|
||||
|
||||
public data class IntHolder(val value: Int)
|
||||
|
||||
+5
@@ -0,0 +1,5 @@
|
||||
# jslib
|
||||
|
||||
Path to sources: `compiler/testData/cli/js/jslib`
|
||||
|
||||
`folderAsLib/LibraryExample.js`, `folderAsLib/LibraryExample.meta.js` and `LibraryExample.jar` should be updated after changing some files in source folder.
|
||||
+1
-1
@@ -1,5 +1,5 @@
|
||||
$TESTDATA_DIR$/withLib.kt
|
||||
-libraries
|
||||
compiler/testData/integration/ant/js/simpleWithStdlibAndFolderAsAnotherLib
|
||||
compiler/testData/integration/ant/js/simpleWithStdlibAndJsFileAsAnotherLib
|
||||
-output
|
||||
$TEMP_DIR$/out.js
|
||||
|
||||
+1
-1
@@ -1,4 +1,4 @@
|
||||
warning: 'compiler/testData/integration/ant/js/simpleWithStdlibAndFolderAsAnotherLib' is not a valid Kotlin Javascript library
|
||||
warning: 'compiler/testData/integration/ant/js/simpleWithStdlibAndJsFileAsAnotherLib' is not a valid Kotlin Javascript library
|
||||
compiler/testData/cli/js/withLib.kt:2:8: error: unresolved reference: library
|
||||
import library.sample.*
|
||||
^
|
||||
|
||||
+1
-1
@@ -1,5 +1,5 @@
|
||||
$TESTDATA_DIR$/withLib.kt
|
||||
-libraries
|
||||
compiler/testData/integration/ant/js/simpleWithStdlibAndFolderAsAnotherLib/jslib-example
|
||||
$TESTDATA_DIR$/folderAsLib
|
||||
-output
|
||||
$TEMP_DIR$/out.js
|
||||
|
||||
+1
-1
@@ -1,5 +1,5 @@
|
||||
$TESTDATA_DIR$/withLib.kt
|
||||
-libraries
|
||||
compiler/testData/integration/ant/js/simpleWithStdlibAndAnotherLib/jslib-example.jar
|
||||
$TESTDATA_DIR$/lib/LibraryExample.jar
|
||||
-output
|
||||
$TEMP_DIR$/out.js
|
||||
|
||||
Reference in New Issue
Block a user