当前位置:网站首页>proxy 的不完整polyfill
proxy 的不完整polyfill
2020-11-09 23:48:00 【阿豪boy】
https://github.com/GoogleChrome/proxy-polyfill
只能针对已有的属性监听
The polyfill supports just a limited number of proxy 'traps'. It also works by calling seal on the object passed to
Proxy
. This means that the properties you want to proxy must be known at creation time.
const proxyPolyfill = require('proxy-polyfill/src/proxy')();
// Your environment may also support transparent rewriting of commonJS to ES6:
// import ProxyPolyfillBuilder from 'proxy-polyfill/src/proxy';
// const proxyPolyfill = ProxyPolyfillBuilder();
const target = {
message1: "hello",
message2: "everyone"
};
const handler2 = {
get: function(target, prop, receiver) {
return "world";
}
};
console.log(proxyPolyfill)
const proxy2 = new proxyPolyfill(target, handler2);
console.log(proxy2.message1,proxy2.message)
// [Function: ProxyPolyfill] { revocable: [Function (anonymous)] }
// world undefined
版权声明
本文为[阿豪boy]所创,转载请带上原文链接,感谢
https://my.oschina.net/ahaoboy/blog/4710395
边栏推荐
- ES6、ES7、ES8学习指南
- day84:luffy:优惠活动策略&用户认证&购物车商品的勾选/结算
- CUDA_ Global memory and access optimization
- 代码中的软件工程--对menu项目的源码分析
- 如何高效进行模幂运算
- 剑指offer之打印二叉搜索树中第k小的结点
- Performance evaluation report of YoMo codec - Y3
- C + + game development
- Python提示AttributeError 或者DeprecationWarning: This module was deprecated解决方法
- Modify the files in the jar package
猜你喜欢
The solution of type interface * * is not known to the mapperregistry
DB-Engines 11月数据库排名:PostgreSQL坐稳同期涨幅榜冠军宝座
Error running app:Default Activity not found 解决方法
商品后台管理实现分析步骤
DB engines database ranking in November: PostgreSQL holds the top spot in the same period
必看!RDS 数据库入门一本通(附网盘链接)
代码中的软件工程--对menu项目的源码分析
Modify the files in the jar package
[best practice] learn how eolinker helps Telecommuting
商品后台系统优化
随机推荐
ES6、ES7、ES8学习指南
Common concepts and points for attention of CUDA
CUDA_常量内存
Configure ng
将Map中对应的key和value赋值到对象中
Traditional purchasing mode has changed! How to innovate automobile purchasing function?
No space left on device
Postman (1) -- function introduction
The basic principle of MRAM
nodejs篇-手写koa中间件
Technical point 5: XML language
Can public IP address and SSL certificate improve SEO?
做个别人家的网页
Daily page number style problems
Visit 2020 PG Technology Conference
Performance evaluation report of YoMo codec - Y3
day84:luffy:优惠活动策略&用户认证&购物车商品的勾选/结算
eleven point nine
会展云技术解读 | 面对突发事故,APP 如何做好崩溃分析与性能监控?
The solution of type interface * * is not known to the mapperregistry