JS lib: export Kotlin object when it possible.

It allows use kotlin.js on node.js without modifications.
This commit is contained in:
Zalim Bashorov
2014-10-13 21:25:00 +04:00
parent 55c19a632a
commit f0078b5e0f
3 changed files with 17 additions and 2 deletions
+7 -2
View File
@@ -219,6 +219,7 @@
<target name="jslib">
<property name="compiled.stdlib.js" value="stdlib.js" />
<property name="stdlib.js.dir" value="${basedir}/js/js.translator/testData" />
<kotlin2js output="${output}/${compiled.stdlib.js}" main="noCall">
<src>
@@ -256,7 +257,7 @@
warning="${warningLevel}"
output="${kotlin-home}/lib/kotlin.js" >
<sources dir="${basedir}/js/js.translator/testData">
<sources dir="${stdlib.js.dir}">
<file name="kotlin_lib_ecma5.js"/>
<file name="kotlin_lib.js"/>
<file name="maps.js"/>
@@ -267,7 +268,11 @@
<file name="${compiled.stdlib.js}"/>
</sources>
<externs dir="${basedir}/js/js.translator/testData">
<sources dir="${stdlib.js.dir}">
<file name="export_Kotlin_if_possible.js"/>
</sources>
<externs dir="${stdlib.js.dir}">
<file name="externs.js"/>
</externs>
</closure-compiler>
@@ -0,0 +1,3 @@
if (typeof module !== 'undefined' && module.exports) {
module.exports = Kotlin;
}
+7
View File
@@ -18,3 +18,10 @@
// from QUnit
function ok() {}
// node.js
var module = {};
var process = {};
// common
var console = {};