decord/source/1613_weakMap.js

40 lines
775 B
JavaScript
Raw Normal View History

2026-07-20 16:05:17 +00:00
// Module ID: 1613
2026-07-24 07:16:23 +00:00
// Function ID: 17915
2026-07-20 16:05:17 +00:00
// Name: weakMap
2026-07-23 10:11:24 +00:00
// Dependencies: [1585]
2026-07-20 16:05:17 +00:00
// Module 1613 (weakMap)
2026-07-23 10:11:24 +00:00
import isJest from "isJest";
isJest = isJest.shouldBeUseWeb();
2026-07-20 16:05:17 +00:00
const SymbolResult = Symbol("shareable flag");
let weakMap = null;
2026-07-23 10:11:24 +00:00
if (!isJest) {
2026-07-20 16:05:17 +00:00
const _WeakMap = WeakMap;
weakMap = new WeakMap();
}
const obj = {};
2026-07-23 10:11:24 +00:00
if (isJest) {
2026-07-20 16:05:17 +00:00
obj.set = function set() {
};
obj.get = function get() {
return null;
};
let tmp7 = obj;
} else {
obj.set = function set(arg0, arg1) {
let tmp = arg1;
if (!arg1) {
2026-07-23 10:11:24 +00:00
tmp = closure_0;
2026-07-20 16:05:17 +00:00
}
const result = weakMap.set(arg0, tmp);
};
const get = weakMap.get;
obj.get = get.bind(weakMap);
tmp7 = obj;
}
export const shareableMappingFlag = SymbolResult;
export const shareableMappingCache = tmp7;