@@ -177,7 +177,7 @@ public boolean compile(
177
177
178
178
final InProcessJsCompRunner jscompRunner ;
179
179
synchronized (GLOBAL_CLOSURE_ARGS_LOCK ) {
180
- jscompRunner = new InProcessJsCompRunner (log , jscompArgs .toArray (new String [0 ]), jsCompiler , exportTestFunctions , checkAssertions );
180
+ jscompRunner = new InProcessJsCompRunner (log , jscompArgs .toArray (new String [0 ]), jsCompiler , exportTestFunctions , checkAssertions , compilationLevel );
181
181
}
182
182
jscompArgs .forEach (log ::debug );
183
183
if (!jscompRunner .shouldRunCompiler ()) {
@@ -197,11 +197,13 @@ static class InProcessJsCompRunner extends CommandLineRunner {
197
197
private final boolean exportTestFunctions ;
198
198
private final boolean checkAssertions ;
199
199
private final Compiler compiler ;
200
+ private final CompilationLevel compilationLevel ;
200
201
private Integer exitCode ;
201
202
202
- InProcessJsCompRunner (BuildLog log , String [] args , Compiler compiler , boolean exportTestFunctions , boolean checkAssertions ) {
203
+ InProcessJsCompRunner (BuildLog log , String [] args , Compiler compiler , boolean exportTestFunctions , boolean checkAssertions , CompilationLevel compilationLevel ) {
203
204
super (args );
204
205
this .compiler = compiler ;
206
+ this .compilationLevel = compilationLevel ;
205
207
this .compiler .setErrorManager (new SortingErrorManager (Collections .singleton (new LoggingErrorReportGenerator (compiler , log ))));
206
208
this .exportTestFunctions = exportTestFunctions ;
207
209
this .checkAssertions = checkAssertions ;
@@ -232,7 +234,9 @@ protected CompilerOptions createOptions() {
232
234
@ Override
233
235
protected void setRunOptions (CompilerOptions options ) throws IOException {
234
236
super .setRunOptions (options );
235
- this .compiler .setPassConfig (new ServiceLoadingPassConfig (options ));
237
+ if (compilationLevel == CompilationLevel .ADVANCED_OPTIMIZATIONS ) {
238
+ this .compiler .setPassConfig (new ServiceLoadingPassConfig (options ));
239
+ }
236
240
}
237
241
}
238
242
0 commit comments