This is an automated email from the ASF dual-hosted git repository.
joshtynjala pushed a commit to branch develop
in repository https://gitbox.apache.org/repos/asf/royale-compiler.git
The following commit(s) were added to refs/heads/develop by this push:
new fc03f3b4f JSClosureCompilerWrapper: fix compiler crash when attempting
to use --remove-circulars=false with a release build
fc03f3b4f is described below
commit fc03f3b4fa9bc93e2492dc3dc7db045656b8fa24
Author: Josh Tynjala <[email protected]>
AuthorDate: Thu Apr 11 10:07:21 2024 -0700
JSClosureCompilerWrapper: fix compiler crash when attempting to use
--remove-circulars=false with a release build
Was giving the following exception from Closure Compiler:
Internal error: com.google.javascript.jscomp.FlagUsageException:
--manage_closure_dependencies cannot be used with --dependency_mode
Presumably, both options were allowed to be set together in previous
versions of Closure Compiler.
From Closure's docs:
> --manage_closure_dependencies will keep any files that do not
goog.provide symbols (whereas --only_closure_dependencies will drop them).
> --dependency_mode=PRUNE_LEGACY will keep any files that do not
goog.provide symbols (whereas --dependency_mode=PRUNE will drop them).
> Using --dependency_mode to Drop Unreferenced Files
> This flag replaces the now deprecated --only_closure_dependencies and
--manage_closure_dependencies flags
So basically, they do the same thing, and manage_closure_dependencies is
deprecated and replaced by dependency_mode dependency_mode=PRUNE_LEGACY, so it
is safe to set dependency_mode=PRUNE_LEGACY only, and leave
manage_closure_dependencies as false.
---
.../java/org/apache/royale/compiler/utils/JSClosureCompilerWrapper.java | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git
a/compiler-jx/src/main/java/org/apache/royale/compiler/utils/JSClosureCompilerWrapper.java
b/compiler-jx/src/main/java/org/apache/royale/compiler/utils/JSClosureCompilerWrapper.java
index b93f27637..0b8c603dd 100644
---
a/compiler-jx/src/main/java/org/apache/royale/compiler/utils/JSClosureCompilerWrapper.java
+++
b/compiler-jx/src/main/java/org/apache/royale/compiler/utils/JSClosureCompilerWrapper.java
@@ -449,7 +449,7 @@ public class JSClosureCompilerWrapper
if (manageDependencies)
entryPoints.add(projectName);
options_.setDependencyOptions(DependencyOptions.fromFlags(manageDependencies ?
DependencyMode.PRUNE_LEGACY : DependencyMode.NONE,
- entryPoints, new ArrayList<String>(),
null, manageDependencies, false));
+ entryPoints, new ArrayList<String>(),
null, false, false));
// warnings already activated in previous incarnation
options_.setWarningLevel(DiagnosticGroups.ACCESS_CONTROLS,
CheckLevel.WARNING);