diff --git a/cocos2d/core/platform/callbacks-invoker.js b/cocos2d/core/platform/callbacks-invoker.js index e246a8e8cc..a68aa55dff 100644 --- a/cocos2d/core/platform/callbacks-invoker.js +++ b/cocos2d/core/platform/callbacks-invoker.js @@ -33,10 +33,10 @@ var JS = require('./js'); * @private */ var CallbacksHandler = (function () { - this._callbackTable = {}; - this._invoking = {}; - this._toRemove = {}; - this._toRemoveAll = null; + this._callbackTable = JS.createMap(true); + this._invoking = JS.createMap(true); + this._toRemove = JS.createMap(true); + this._toRemoveAll = ''; }); // Avoid to equal to user set target (null for example) diff --git a/cocos2d/core/platform/js.js b/cocos2d/core/platform/js.js index ae47d2c852..daffb1fcfa 100644 --- a/cocos2d/core/platform/js.js +++ b/cocos2d/core/platform/js.js @@ -631,8 +631,9 @@ js.shiftArguments = function () { js.createMap = function (forceDictMode) { var map = Object.create(null); if (forceDictMode) { - map["__"] = undefined; - delete map["__"]; + const INVALID_IDENTIFIER = '.'; + map[INVALID_IDENTIFIER] = true; + delete map[INVALID_IDENTIFIER]; } return map; };