当前位置:网站首页>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
边栏推荐
- Error running app:Default Activity not found 解决方法
- Application of V7 version of lvgl Library
- asp.net Using serilog in core and customizing enrich
- 2020-11-09:谈谈布隆过滤器和布谷鸟过滤器的相同点和不同点?
- mongodb内核源码实现、性能调优、最佳运维实践系列-command命令处理模块源码实现一
- sql 截取数据中 ‘.’的前后数据
- SSL证书和公网IP地址如何影响SEO
- ES6, ES7, es8 Learning Guide
- Realization of commodity backstage system
- How to greatly improve the performance of larravel framework under php7? Install stone!
猜你喜欢

公网IP地址和SSL证书可以提升SEO吗?

Jingtao project Day10

The problem of looting by leetcode

Unemployment after graduation? How do college students allocate their study time and have a complete computer knowledge system?

快来学习!个性化推荐系统开发指南(附网盘链接)

Operation and design of rights management in ERP

毕业设计之 ---基于微服务框架的电影院订票系统

So what should investors do with the current market? Now a new investment outlet is coming!

Do you know your server? Do you know what's inside the server

必看!RDS 数据库入门一本通(附网盘链接)
随机推荐
Python提示AttributeError 或者DeprecationWarning: This module was deprecated解决方法
将Map中对应的key和value赋值到对象中
当我们开发一个接口时需要注意些什么
动物园[CSP2020]
必看!RDS 数据库入门一本通(附网盘链接)
Can public IP address and SSL certificate improve SEO?
The basic principle of MRAM
Prometheus安装配置
The problem of looting by leetcode
[best practice] learn how eolinker helps Telecommuting
Daily page number style problems
Modify the files in the jar package
没有磁盘空间 No space left on device
11.9
会展云技术解读 | 面对突发事故,APP 如何做好崩溃分析与性能监控?
2020-11-09:谈谈布隆过滤器和布谷鸟过滤器的相同点和不同点?
Python prompt attributeerror or depreciation warning: This module was degraded solution
如何实现LRU算法
Jingtao project Day10
Important components of Apache Hadoop