Command-line tool for JS DCE

This commit is contained in:
Alexey Andreev
2017-04-24 17:20:14 +03:00
parent ca7062d776
commit 8a8fdf1968
46 changed files with 559 additions and 207 deletions
+1
View File
@@ -0,0 +1 @@
-help
+9
View File
@@ -0,0 +1,9 @@
Usage: kotlin-dce-js <options> <source files>
where possible options include:
-output-dir <path> Output directory
-help (-h) Print a synopsis of standard options
-X Print a synopsis of advanced options
-version Display compiler version
-verbose Enable verbose logging output
-nowarn Generate no warnings
OK
+2
View File
@@ -0,0 +1,2 @@
-output-dir
$TESTDATA_DIR$/min
+2
View File
@@ -0,0 +1,2 @@
error: no source files
COMPILATION_ERROR
+8
View File
@@ -0,0 +1,8 @@
info:
info: <unknown>
info: global
info: bar (reachable)
info: foo (reachable)
info: include
info: baz (reachable from include.js:14)
OK
+1
View File
@@ -0,0 +1 @@
-X
+6
View File
@@ -0,0 +1,6 @@
Usage: kotlin-dce-js <options> <source files>
where advanced options include:
-Xprint-reachability-info Print declarations marked as reachable
Advanced options are non-standard and may be changed or removed without any notice.
OK
+4
View File
@@ -0,0 +1,4 @@
function bar() {
return 'bar';
}
console.log(bar());
@@ -0,0 +1,3 @@
nonExistingSourceFile.js
-output-dir
$TEMP_DIR/min
@@ -0,0 +1,2 @@
error: source file or directory not found: nonExistingSourceFile.js
COMPILATION_ERROR
@@ -0,0 +1 @@
// ABSENT: min/nonExistingSourceFile.js
+3
View File
@@ -0,0 +1,3 @@
$TESTDATA_DIR$
-output-dir
$TEMP_DIR/min
+2
View File
@@ -0,0 +1,2 @@
error: input file 'compiler/testData/cli/js-dce' is a directory
COMPILATION_ERROR
+3
View File
@@ -0,0 +1,3 @@
$TESTDATA_DIR$/simple.js
-output-dir
$TESTDATA_DIR$/min
+2
View File
@@ -0,0 +1,2 @@
error: cannot open output file '$TESTDATA_DIR$/min/simple.js': is a directory
COMPILATION_ERROR
+1
View File
@@ -0,0 +1 @@
// ABSENT: out.js
+3
View File
@@ -0,0 +1,3 @@
$TESTDATA_DIR$/simple.js:bar
-output-dir
$TEMP_DIR$/min
+1
View File
@@ -0,0 +1 @@
OK
+1
View File
@@ -0,0 +1 @@
// EXISTS: min/bar.js
+4
View File
@@ -0,0 +1,4 @@
$TESTDATA_DIR$/simple.js
-output-dir
$TEMP_DIR$/min
-Xprint-reachability-info
+6
View File
@@ -0,0 +1,6 @@
info:
info: <unknown>
info: bar (reachable from simple.js:7)
info: console
info: log (reachable from simple.js:7)
OK
+1
View File
@@ -0,0 +1 @@
// EXISTS: min/simple.js
+3
View File
@@ -0,0 +1,3 @@
$TESTDATA_DIR$/simple.js
-output-dir
$TEMP_DIR$/min
+7
View File
@@ -0,0 +1,7 @@
function foo() {
return "foo";
}
function bar() {
return "bar";
}
console.log(bar());
+1
View File
@@ -0,0 +1 @@
OK
+1
View File
@@ -0,0 +1 @@
// EXISTS: min/simple.js