I've encountered an unexpected issue with the Google Closure Compiler in ADVANCED mode, and I'm struggling to understand it: it's renaming the function resetTransform of CanvasRenderingContext2D
Unfortunately, I can't directly share the production code where this problem occurred. However, I have managed to replicate the issue in a separate case available here
The snippet causing trouble is:
context.resetTransform ()
context.translate ( 0 , canvas.height )
which is being compiled as:
c.a();c.translate(0,b.height);
It seems like resetTransform should retain its original name, just like other members of CanvasRenderingContext2D. This mismatch is leading the browser to throw a "TypeError: c.a is not a function" error.
"c" is indeed an instance of CanvasRenderingContext2D. When I manually change c.a to c.resetTransform, everything works as expected.
I'm puzzled by this issue as I haven't found any documentation or references to it elsewhere.
I'm currently using the latest version of the compiler, which can be downloaded from:
I'm running java version 1.7.0_80, but even switching to an older version hasn't resolved the problem.