Lines 228-268javascript
229var WindowPluginImpl = /*#__PURE__*/function () {
230 function WindowPluginImpl() {
231 _classCallCheck(this, WindowPluginImpl);
232 _defineProperty(this, "name", 'window');
233 _defineProperty(this, "version", '1.0.0');
235 _defineProperty(this, "setTimeout", Object.assign(function (handler, timeout) {
236 for (var _len = arguments.length, args = new Array(_len > 2 ? _len - 2 : 0), _key = 2; _key <
237 args[_key - 2] = arguments[_key];
239 if (typeof globalThis !== 'undefined' && globalThis.setTimeout) {
240 return globalThis.setTimeout.apply(globalThis, [handler, timeout].concat(args));
242 // Fallback 实现,使用 Promise 模拟
243 var timeoutId = Date.now();
244 Promise.resolve().then(function () {
245 setTimeout(function () {
246 if (typeof handler === 'function') {
247 handler.apply(void 0, args);
250 }
LowEval
Package source references a known benign dynamic code generation pattern.
dist/plugins/window.jsView on unpkg · L248 255 __promisify__: function __promisify__(delay, value) {
256 return new Promise(function (resolve) {
257 return setTimeout(resolve, delay, value);
261 _defineProperty(this, "clearTimeout", function (timeout) {
262 if (typeof globalThis !== 'undefined' && globalThis.clearTimeout) {
263 globalThis.clearTimeout(timeout);
267 _defineProperty(this, "setInterval", Object.assign(function (handler, timeout) {