[FIXED] Closure compiler LabelBMFont loose colors

When launching the TestColors function, the colors of the LabelBMFont are lost (it becames black) if compiling the code in a single js file (with closure compiler, both simple and advanced mode).
Works perfectly when not compiled.

Here is the code
In resources.js i added

var s_HelloWorld = "res/HelloWorld.png";
var s_CloseNormal = "res/CloseNormal.png";
var s_CloseSelected = "res/CloseSelected.png";
var f_F32 = "res/konqa32.fnt",t_F32 = "res/konqa32.png";

var g_resources = [
    //image
    {src:s_HelloWorld},
    {src:s_CloseNormal},
    {src:s_CloseSelected},
    //fnt
    {src:f_F32},{src:t_F32}
];

In MyApp.js, init()

...
        this.sprite.runAction(cc.Sequence.create(rotateToA, scaleToA));
        this.helloLabel.runAction(cc.Spawn.create(cc.MoveBy.create(2.5, cc.p(0, size.height - 40)),cc.TintTo.create(2.5,255,125,0)));

        //START ADDED CODE
        this.lTest = cc.LabelBMFont.create("TEST COLORS",f_F32);
        this.lTest.setColor(cc.ORANGE);
        var milTest = cc.MenuItemLabel.create(this.lTest,this.TestColors,this);
        milTest.setPosition(cc.p(400,350));
        var _Menu = cc.Menu.create(milTest);
        _Menu.setPosition(cc.p(0,0));
        this.addChild(_Menu);
        //END ADDED CODE

        this.setTouchEnabled(true);
        return true;
    },
    //ADDED FUNCTION
    TestColors:function (sender) {
        this.lTest.setColor(cc.GREEN);
        this.helloLabel.setColor(cc.GREEN);
    },//END ADDED FUNCTION

    // a selector callback
    menuCloseCallback:function (sender) {
        cc.Director.getInstance().end();
    },
...

Happens using 2.2.1, 2.2 and 2.1.5.
Any ideas? Is it a bug?

I took some pictures for a better explanation.

These are in normal mode. Before:

and after launching the TestColor function:

These are compiled with closure compliler simple mode. Before (orange color is falsed):

and after (black instead of green):

Hi,Alek Borg.
This problem have fixed at [[https://github.com/cocos2d/cocos2d-html5/commit/48bc6244653a2474864daf4df47e61b1977b6787]]

Thank you for your answer, Xingsen Ma, but it seems that that patch didn’t fix the above problem at all.
I just downloaded the latest github, and even checked wether the code at CCLabelBMFont.js was the right one as indicated in your url, but what i described is still there :frowning:

Which branch had you downloaded from github, develop or master?

I downloaded the develop one.

Hi,Alek Borg.
It is a bug that displayedColor andrealColor use the same Pointer when compile single js file
Look Attachment.

commit:
https://github.com/cocos2d/cocos2d-html5/pull/1311

Thanks your feedback.

Thank you, you’re doing great!