Cocos2D-JS cc.IMEDispatcher is broken (by Box2DWeb)

Cocos2D-JS cc.IMEDispatcher is broken (by Box2DWeb)
0

#1

I’m not exactly sure what caused this issue to suddenly appear, especially considering that the error happens on initial load and was working fine before. It still appears even if I do not setKeyboardEnabled.

The problem is in CCIMEDispatcher.js: I can see that the class is defined to extend cc.Class and that definition definitely includes an init function:

cc.IMEDispatcher = cc.Class.extend(/**  @lends cc.imeDispatcher# */{

Then at the bottom of the same file

// Initialize imeDispatcher singleton
cc.imeDispatcher = new cc.IMEDispatcher();

document.body ?
    cc.imeDispatcher.init() : <-- this line
    cc._addEventListener(window, 'load', function () {
        cc.imeDispatcher.init();
    }, false);

When it runs, it crashes because cc.imeDispatcher does not have an init method. Or any other method; I checked it in the debugger and it’s a blank object.

Uncaught TypeError: undefined is not a function (11:01:01:082 | error, javascript)
    at (anonymous function) (frameworks/cocos2d-html5/cocos2d/text-input/CCIMEDispatcher.js:520:22)
Uncaught TypeError: undefined is not a function (11:01:01:088 | error, javascript)
    at cc.eventManager.addListener (frameworks/cocos2d-html5/cocos2d/core/event-manager/CCEventManager.js:662:25)
    at cc.eventManager.addCustomListener (frameworks/cocos2d-html5/cocos2d/core/event-manager/CCEventManager.js:698:14)
    at (anonymous function) (frameworks/cocos2d-html5/cocos2d/audio/CCAudio.js:1063:17)

EDIT

Just did a test and it looks like the problem is being caused by Box2DWeb. I’m using Cocos2D-JS v3.0rc0 and simply including the Box2dWeb-2.1.a.3 file before including main.js in the default hello world results in the same error.


#2

Just downloaded the latest source and I’m getting the same issue.


#3

Any solutions to this?