Skip to content
This repository has been archived by the owner on Sep 8, 2024. It is now read-only.

直接 import 'es6-proxy-polyfill'; 不能全局 Polyfill 其他使用 Proxy 的三方库 #12

Open
sbyps opened this issue Aug 6, 2024 · 5 comments

Comments

@sbyps
Copy link

sbyps commented Aug 6, 2024

import 'es6-proxy-polyfill';
同时使用 pixi.js7.4.2版本,pixi7.4.2版本中有 new Proxy 代码,但并没有被polyfill,chrome39报错 Uncaught ReferenceError: Proxy is not defined

@ambit-tsai
Copy link
Owner

你项目导入的应该是dist/es6-proxy-polyfill.mjs,mjs这个是没有做全局polyfill的。

简单处理一下

import Proxy from 'es6-proxy-polyfill';

if (!widow.Proxy) {
  widow.Proxy = Proxy;
}

这年头还有人要兼容Proxy,也太苦了吧

@sbyps
Copy link
Author

sbyps commented Aug 6, 2024

是太苦了,因为用了 pixi7.4.2,这个包用了 Proxy

@ambit-tsai
Copy link
Owner

有一点要注意,Proxy是没办法完全兼容的

@sbyps
Copy link
Author

sbyps commented Aug 6, 2024

能支持 Proxy 动态属性吗,https://github.com/pixijs/pixijs/blob/v7.x/packages/assets/src/loader/Loader.ts 这里面的使用方法

@ambit-tsai
Copy link
Owner

有限的支持

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants