C.js代码:
/** * 有BUG */ (function (global) { var _id; var _map; var _length; global.C = function () { _map = {}; _length = 0; }; global.C.prototype = { setId: function (id) { _id = id; }, getId: function () { return _id; }, put: function (key, value) { if (!_map.hasOwnProperty(key)) { _length++; } _map[key] = value; }, get: function (key) { if (_map.hasOwnProperty(key)) { return _map[key]; } return null; }, }; global.C.prototype.constructor = global.C; })(window);