KJS: allow to use packages with names starting with "kotlin" only if the -Xallow-kotlin-package command line option is specified

#KT-14668 Fixed
This commit is contained in:
Zalim Bashorov
2017-01-27 04:14:00 +03:00
parent 7195e26ae2
commit 29ac01f2e2
16 changed files with 84 additions and 30 deletions
+1
View File
@@ -2,6 +2,7 @@ Usage: kotlinc-js <options> <source files>
where advanced options include:
-Xno-inline Disable method inlining
-Xrepeat <count> Repeat compilation (for performance analysis)
-Xallow-kotlin-package Allow compiling code in package 'kotlin'
-Xplugin <path> Load plugins from the given classpath
-Xmulti-platform Enable experimental language support for multi-platform projects
-Xno-check-impl Do not check presence of 'impl' modifier in multi-platform projects
+4
View File
@@ -0,0 +1,4 @@
$TESTDATA_DIR$/../kotlinPackage.kt
-no-stdlib
-output
$TEMP_DIR$/out.js
+4
View File
@@ -0,0 +1,4 @@
compiler/testData/cli/kotlinPackage.kt:1:1: error: only the Kotlin standard library is allowed to use the 'kotlin' package
package kotlin.mylibrary
^
COMPILATION_ERROR
+1 -1
View File
@@ -5,7 +5,6 @@ where advanced options include:
-Xno-optimize Disable optimizations
-Xreport-perf Report detailed performance statistics
-Xmultifile-parts-inherit Compile multifile classes as a hierarchy of parts and facade
-Xallow-kotlin-package Allow compiling code in package 'kotlin'
-Xskip-metadata-version-check Load classes with bad metadata version anyway (incl. pre-release classes)
-Xskip-runtime-version-check Allow Kotlin runtime libraries of incompatible versions in the classpath
-Xdump-declarations-to <path> Path to JSON file to dump Java to Kotlin declaration mappings
@@ -15,6 +14,7 @@ where advanced options include:
Load definitions of built-in declarations from module dependencies, instead of from the compiler
-Xno-inline Disable method inlining
-Xrepeat <count> Repeat compilation (for performance analysis)
-Xallow-kotlin-package Allow compiling code in package 'kotlin'
-Xplugin <path> Load plugins from the given classpath
-Xmulti-platform Enable experimental language support for multi-platform projects
-Xno-check-impl Do not check presence of 'impl' modifier in multi-platform projects
+1 -1
View File
@@ -1,3 +1,3 @@
$TESTDATA_DIR$/kotlinPackage.kt
$TESTDATA_DIR$/../kotlinPackage.kt
-d
$TEMP_DIR$
+1 -1
View File
@@ -1,4 +1,4 @@
compiler/testData/cli/jvm/kotlinPackage.kt:1:1: error: only the Kotlin standard library is allowed to use the 'kotlin' package
compiler/testData/cli/kotlinPackage.kt:1:1: error: only the Kotlin standard library is allowed to use the 'kotlin' package
package kotlin.mylibrary
^
COMPILATION_ERROR