提交 a452260d 编写于 作者: A Alexey Andreev

JS: simplify merging kotlin.js

上级 ac4bfc64
......@@ -375,6 +375,19 @@
<file name="externs.js"/>
</externs>
</closure-compiler>
<replaceregexp file="${js.stdlib.output.dir}/kotlin.js"
match="module.exports,\s*require\([^)]+\)"
replace=""
byline="true" encoding="UTF-8" />
<replaceregexp file="${js.stdlib.output.dir}/kotlin.js"
match="function\s*\(_,\s*Kotlin\)"
replace="function()"
byline="true" encoding="UTF-8" />
<replaceregexp file="${js.stdlib.output.dir}/kotlin.js"
match="return\s+_;"
replace=""
byline="true" encoding="UTF-8" />
</target>
<target name="js-stdlib">
......@@ -401,15 +414,6 @@
<move file="${js.stdlib.output.dir}/tmp/kotlin" todir="${js.stdlib.output.dir}" />
<move file="${js.stdlib.output.dir}/tmp/${compiled.stdlib.meta.js}" tofile="${js.stdlib.output.dir}/${compiled.stdlib.meta.js}" />
<replaceregexp file="${js.stdlib.output.dir}/builtins.js"
match="module.exports,\s*require\([^)]+\)"
replace="Kotlin, Kotlin"
byline="true" encoding="UTF-8" />
<replaceregexp file="${js.stdlib.output.dir}/${compiled.stdlib.js}"
match="module.exports,\s*require\([^)]+\)"
replace="Kotlin, Kotlin"
byline="true" encoding="UTF-8" />
<condition property="jdk17" value="${env.JDK_17}" else="${env.JAVA_HOME}">
<isset property="env.JDK_17" />
</condition>
......
(function (root, factory) {
if (typeof define === 'function' && define.amd) {
define('kotlin', [], factory);
} else if (typeof exports === 'object') {
module.exports = factory();
} else {
root.kotlin = factory();
define('kotlin', ['exports'], factory);
}
}(this, function () {
var Kotlin = {};
else if (typeof exports === 'object') {
factory(module.exports);
}
else {
root.kotlin = {};
factory(root.kotlin);
}
}(this, function (Kotlin) {
var _ = Kotlin;
%output%
return Kotlin;
}));
\ No newline at end of file
......@@ -14,9 +14,7 @@
* limitations under the License.
*/
(function (Kotlin) {
'use strict';
(function () {
function toArray(obj) {
var array;
if (obj == null) {
......@@ -613,9 +611,6 @@
* @param {Object} declaration
*/
Kotlin.defineModule = function (id, declaration) {
if (typeof declaration.$initializer$ === "function") {
declaration.$initializer$.call(declaration); // TODO: temporary hack
}
Kotlin.modules[id] = declaration;
};
......@@ -656,4 +651,4 @@
Kotlin.kotlinModuleMetadata = function (abiVersion, moduleName, data) {
};
})(Kotlin);
})();
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册