/
Alcatraz
/
Wagomon
Обзор
Документация
Войти
/
Alcatraz
/
Wagomon
Код
Запросы
0
Задачи
Вики
Пакеты
0
Релизы
0
CI/CD
Аналитика
Безопасность
master
node_modules/zrender/lib/core/WeakMap.js
42 строки
1 KB
saitgalineu
fix
27 фев 2026, 12:39
27 фев 2026, 12:39
a5092f1
Код
Авторство
О чём код?
var wmUniqueIndex = Math.round(Math.random() * 9); var supportDefineProperty = typeof Object.defineProperty === 'function'; var WeakMap = (function () { function WeakMap() { this._id = '__ec_inner_' + wmUniqueIndex++; } WeakMap.prototype.get = function (key) { return this._guard(key)[this._id]; }; WeakMap.prototype.set = function (key, value) { var target = this._guard(key); if (supportDefineProperty) { Object.defineProperty(target, this._id, { value: value, enumerable: false, configurable: true }); } else { target[this._id] = value; } return this; }; WeakMap.prototype["delete"] = function (key) { if (this.has(key)) { delete this._guard(key)[this._id]; return true; } return false; }; WeakMap.prototype.has = function (key) { return !!this._guard(key)[this._id]; }; WeakMap.prototype._guard = function (key) { if (key !== Object(key)) { throw TypeError('Value of WeakMap is not a non-null object.'); } return key; }; return WeakMap; }()); export default WeakMap;