Procházet zdrojové kódy

chore: fix Blob test in latest nodejs

tophf před 3 roky
rodič
revize
2c8795f3dc
1 změnil soubory, kde provedl 4 přidání a 2 odebrání
  1. 4 2
      test/mock/polyfill.js

+ 4 - 2
test/mock/polyfill.js

@@ -27,9 +27,11 @@ global.chrome = {
 if (!window.Response) window.Response = { prototype: {} };
 if (!window.Response) window.Response = { prototype: {} };
 const domProps = Object.getOwnPropertyDescriptors(window);
 const domProps = Object.getOwnPropertyDescriptors(window);
 for (const k of Object.keys(domProps)) {
 for (const k of Object.keys(domProps)) {
-  if (k.endsWith('Storage') || k in global) delete domProps[k];
+  // Skipping ***Storage and native global methods
+  if (k.endsWith('Storage') || /^[a-z]/.test(k) && (k in global)) {
+    delete domProps[k];
+  }
 }
 }
-delete domProps.performance;
 Object.defineProperties(global, domProps);
 Object.defineProperties(global, domProps);
 global.__VAULT_ID__ = false;
 global.__VAULT_ID__ = false;
 Object.assign(global, require('#/common/safe-globals'));
 Object.assign(global, require('#/common/safe-globals'));