当前位置:网站首页>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
边栏推荐
- Hengxun Technology: the way to deal with server downtime
- Jingtao project Day10
- Open source project, private tool, rapid development
- 没有磁盘空间 No space left on device
- 代码中的软件工程--对menu项目的源码分析
- Common settings of PLSQL developer
- DB engines database ranking in November: PostgreSQL holds the top spot in the same period
- The problem of looting by leetcode
- Software engineering in code -- source code analysis of menu project
- 探访2020 PG技术大会
猜你喜欢

Top 5 Chinese cloud manufacturers in 2018: Alibaba cloud, Tencent cloud, AWS, telecom, Unicom

C + + game development

IP地址SSL证书

【CentOS7操作系统安全加固系列】第(2)篇

Hengxun Technology: the way to deal with server downtime

Error running app:Default Activity not found 解决方法
![[best practice] learn how eolinker helps Telecommuting](/img/3b/00bc81122d330c9d59909994e61027.jpg)
[best practice] learn how eolinker helps Telecommuting

商品后台系统优化

Validation failed for one or more entities. See 'entityvalidationerrors' solution

在PHP7下怎么大幅度提升Laravel框架性能?安装Stone!
随机推荐
Configure ng
商品后台系统实现
做个别人家的网页
SQL case conversion, remove the space before and after
Top 5 Chinese cloud manufacturers in 2018: Alibaba cloud, Tencent cloud, AWS, telecom, Unicom
C + + game development
日常页码样式问题
将Map中对应的key和value赋值到对象中
Important components of Apache Hadoop
如何实现LRU算法
面试官:缓存穿透、缓存雪崩和缓存击穿是什么?
AQS source code in-depth analysis of conditional queue
函数计算进阶-IP查询工具开发
必看!RDS 数据库入门一本通(附网盘链接)
The movie theater booking system based on micro Service Framework
没有磁盘空间 No space left on device
Visit 2020 PG Technology Conference
如何k个一组反转链表
【CentOS7操作系统安全加固系列】第(2)篇
2018中国云厂商TOP5:阿里云、腾讯云、AWS、电信、联通 ...