当前位置:网站首页>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
边栏推荐
- How to carry out modular power operation efficiently
- Daily page number style problems
- What can CRM system help enterprises do?
- Formal class D25
- How to greatly improve the performance of larravel framework under php7? Install stone!
- Do you know your server? Do you know what's inside the server
- The movie theater booking system based on micro Service Framework
- Apache Hadoop的重要组成
- 公网IP地址和SSL证书可以提升SEO吗?
- No space left on device
猜你喜欢
CUDA_共享内存、访存机制、访问优化
Must see! RDS database all in one
2018中国云厂商TOP5:阿里云、腾讯云、AWS、电信、联通 ...
win7+vs2015+cuda10.2配置TensorRT7.0
So what should investors do with the current market? Now a new investment outlet is coming!
lvgl 库 V7版本相关应用
Python提示AttributeError 或者DeprecationWarning: This module was deprecated解决方法
那么当下的行情投资者该怎么办呢? 现在新的投资风口来了!
如何实现LRU算法
Common settings of PLSQL developer
随机推荐
2018中国云厂商TOP5:阿里云、腾讯云、AWS、电信、联通 ...
Optimization of commodity backstage system
技术点5:XML语言
asp.net core中使用Serilog以及自定义Enricher
2020-11-09:谈谈布隆过滤器和布谷鸟过滤器的相同点和不同点?
eleven point nine
当我们开发一个接口时需要注意些什么
How SSL certificate and public IP address affect SEO
害怕重构?都怪我太晚和你介绍该如何重构,现在我来了
日常页码样式问题
函数计算进阶-IP查询工具开发
LeetCode 50 Pow(x,n)
What is the SRM system? SRM supplier management system functions
Python中[:]与[::]的用法
动物园[CSP2020]
Python prompt attributeerror or depreciation warning: This module was degraded solution
做个别人家的网页
商品后台系统优化
SQL server attached database access denial resolution summary
Validation failed for one or more entities. See 'entityvalidationerrors' solution