Opened 5 years ago

Last modified 5 years ago

#18974 new defect

Closure compiler does not fail when encountering JS errors

Reported by: rmaccracken Owned by:
Priority: high Milestone: 1.14
Component: BuildSystem Version: 1.11.2
Keywords: Cc:
Blocked By: Blocking:


When our JS code has an error, such as a trailing comma, the closure compiler reports an error, but continues to process all files. In the end, the error seems to be ignored and reports that the build succeeded.

I think it makes more sense for the compiler to fail and report these errors. We have patched the following build script as follows:

file: dojo/util/build/transforms/optimizer/closure.js

change line: compiler.compile(externSourceFile, jsSourceFile, options);

to: var complierResult = compiler.compile(externSourceFile, jsSourceFile, options); if (!complierResult.success)

throw new Error("Error during Closure optimization");

It would be great to have this either as a build option or just part of the normal build.

Change History (2)

comment:1 Changed 5 years ago by dylan

Milestone: tbd1.13
Priority: undecidedhigh

comment:2 Changed 5 years ago by dylan

Milestone: 1.131.14
Note: See TracTickets for help on using tickets.