Merging https://github.com/cocos2d/cocos2d-x/pull/2245 and updating JS Test.