[Resolved]Closure compiler in advanced mode

[Resolved]Closure compiler in advanced mode
0.0 0


Does closure compiler in advanced mode actually work?

Starting from HelloHTML5World, adding in build.xml
<externs dir="${basedir}/../cocos2d"> <file name="cocos2d_externs.js"/> </externs>
and exluding
<!--file name="platform/jsloader.js"/-->
works perfectly in simple mode,
but in advanced mode it stops with a
TypeDef Error: sa is undefined (on firefox, refers sa.useProgram(a))
Uncaught TypeError: Cannot call method 'useProgram' of undefined (on chrome)

Tried to download the latest compiler.jar but nothing changes.
Am i missing any extern? Did anybody already find a solution?


Hi Alek,

I think to cause this issue is that the ‘gl’ is a global variable, some reason cause this variable set to undefine or other value.

please modify ‘gl.useProgram(program);’ to ‘cc.renderContext.useProgram(program);’ in cocos2d/shaders/CCGLStateCache.js, and try again.

We will fix this issue soon.

Best regards!


Thank you, David!
Now it works perfectly.