JS: fix building stubs for JS library that contains classes in default package

This commit is contained in:
Alexey Andreev
2016-11-23 17:57:56 +03:00
parent efeccd0929
commit 20669c1b97
2 changed files with 1 additions and 10 deletions
-9
View File
@@ -420,15 +420,6 @@
</src>
</new-kotlin2js>
<!-- TODO: it's a temporary hack, until IDEA indexer learns how to process this correctly -->
<delete file="${js.stdlib.output.dir}/tmp/kotlin/BaseOutput.kjsm"/>
<delete file="${js.stdlib.output.dir}/tmp/kotlin/BufferedOutput.kjsm"/>
<delete file="${js.stdlib.output.dir}/tmp/kotlin/BufferedOutputToConsoleLog.kjsm"/>
<delete file="${js.stdlib.output.dir}/tmp/kotlin/NodeJsOutput.kjsm"/>
<delete file="${js.stdlib.output.dir}/tmp/kotlin/OutputToConsoleLog.kjsm"/>
<delete file="${js.stdlib.output.dir}/tmp/kotlin/PropertyMetadata.kjsm"/>
<!-- -->
<move file="${js.stdlib.output.dir}/tmp-builtins/kotlin.js" tofile="${js.stdlib.output.dir}/builtins.js" />
<move file="${js.stdlib.output.dir}/tmp/kotlin.js" tofile="${js.stdlib.output.dir}/${compiled.stdlib.js}" />
<move file="${js.stdlib.output.dir}/tmp/kotlin" todir="${js.stdlib.output.dir}" />
@@ -57,7 +57,7 @@ object JsMetaFileUtils {
private fun getPackageFqName(relPath: String): FqName {
val pathToFile = relPath.substringAfter(VfsUtilCore.VFS_SEPARATOR_CHAR)
if (isDefaultPackageMetafile(pathToFile)) return FqName.ROOT
if (isDefaultPackageMetafile(pathToFile) || !pathToFile.contains(VfsUtilCore.VFS_SEPARATOR_CHAR)) return FqName.ROOT
val name = pathToFile.substringBeforeLast(VfsUtilCore.VFS_SEPARATOR_CHAR)
return FqName(name.replace(VfsUtilCore.VFS_SEPARATOR_CHAR, '.'))