mirror of
https://github.com/clash-verge-rev/clash-verge-rev
synced 2025-05-05 23:03:44 +08:00
17 lines
321 B
JavaScript
17 lines
321 B
JavaScript
(function () {
|
|
if (typeof window.WeakRef !== "undefined") {
|
|
return;
|
|
}
|
|
|
|
window.WeakRef = (function (weakMap) {
|
|
function WeakRef(target) {
|
|
weakMap.set(this, target);
|
|
}
|
|
WeakRef.prototype.deref = function () {
|
|
return weakMap.get(this);
|
|
};
|
|
|
|
return WeakRef;
|
|
})(new WeakMap());
|
|
})();
|