decord/source/1685_weakMap.js

41 lines
815 B
JavaScript
Raw Normal View History

2026-08-15 05:55:55 +00:00
// Module ID: 1685
// Function ID: 1686
2026-07-20 16:05:17 +00:00
// Name: weakMap
2026-08-15 05:55:55 +00:00
// Dependencies: [1657]
2026-07-20 16:05:17 +00:00
2026-08-15 05:55:55 +00:00
// Module 1685 (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");
2026-07-29 08:29:29 +00:00
let c0 = SymbolResult;
2026-07-20 16:05:17 +00:00
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();
}
2026-07-29 08:29:29 +00:00
const obj = { set: null, get: null };
2026-07-23 10:11:24 +00:00
if (isJest) {
2026-07-29 08:29:29 +00:00
obj[0] = function set() {
2026-07-20 16:05:17 +00:00
};
2026-07-29 08:29:29 +00:00
obj[1] = function get() {
2026-07-20 16:05:17 +00:00
return null;
};
let tmp7 = obj;
} else {
2026-07-29 08:29:29 +00:00
obj[0] = function set(arg0, arg1) {
2026-07-20 16:05:17 +00:00
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;
2026-07-29 08:29:29 +00:00
obj[1] = get.bind(weakMap);
2026-07-20 16:05:17 +00:00
tmp7 = obj;
}
export const shareableMappingFlag = SymbolResult;
export const shareableMappingCache = tmp7;