@micro-zoe/micro-app 0.6.1 → 0.6.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/lib/index.esm.js CHANGED
@@ -1,4 +1,4 @@
1
- const version = '0.6.1';
1
+ const version = '0.6.2';
2
2
  // do not use isUndefined
3
3
  const isBrowser = typeof window !== 'undefined';
4
4
  // do not use isUndefined
@@ -366,6 +366,13 @@ function initGlobalEnv() {
366
366
  const rawGetElementsByClassName = Document.prototype.getElementsByClassName;
367
367
  const rawGetElementsByTagName = Document.prototype.getElementsByTagName;
368
368
  const rawGetElementsByName = Document.prototype.getElementsByName;
369
+ const ImageProxy = new Proxy(Image, {
370
+ construct(Target, args) {
371
+ const elementImage = new Target(...args);
372
+ elementImage.__MICRO_APP_NAME__ = getCurrentAppName();
373
+ return elementImage;
374
+ },
375
+ });
369
376
  const rawWindow = Function('return window')();
370
377
  const rawDocument = Function('return document')();
371
378
  const supportModuleScript = isSupportModuleScript();
@@ -403,6 +410,7 @@ function initGlobalEnv() {
403
410
  rawGetElementsByClassName,
404
411
  rawGetElementsByTagName,
405
412
  rawGetElementsByName,
413
+ ImageProxy,
406
414
  // common global vars
407
415
  rawWindow,
408
416
  rawDocument,
@@ -1774,14 +1782,6 @@ function effect(microWindow) {
1774
1782
  };
1775
1783
  }
1776
1784
 
1777
- const ImageProxy = new Proxy(Image, {
1778
- construct(Target, args) {
1779
- const elementImage = new Target(...args);
1780
- elementImage.__MICRO_APP_NAME__ = getCurrentAppName();
1781
- return elementImage;
1782
- },
1783
- });
1784
-
1785
1785
  // Variables that can escape to rawWindow
1786
1786
  const staticEscapeProperties = [
1787
1787
  'System',
@@ -1861,7 +1861,7 @@ class SandBox {
1861
1861
  case 'eval':
1862
1862
  return eval;
1863
1863
  case 'Image':
1864
- return ImageProxy;
1864
+ return globalEnv.ImageProxy;
1865
1865
  }
1866
1866
  }
1867
1867
  if (Reflect.has(target, key)) {