当前位置:网站首页>Incomplete Polyfill of proxy
Incomplete Polyfill of proxy
2020-11-09 23:48:00 【Ah ho boy】
https://github.com/GoogleChrome/proxy-polyfill
Only listen for existing attributes
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
版权声明
本文为[Ah ho boy]所创,转载请带上原文链接,感谢
边栏推荐
- Application of V7 version of lvgl Library
- Top 5 Chinese cloud manufacturers in 2018: Alibaba cloud, Tencent cloud, AWS, telecom, Unicom
- Gets the property value of a column in the list collection object
- Functional guide for temporary users and novices of PL / SQL developer
- How to make a set of K reverse linked lists
- Validation failed for one or more entities. See 'entityvalidationerrors' solution
- Top 5 Chinese cloud manufacturers in 2018: Alibaba cloud, Tencent cloud, AWS, telecom, Unicom
- Realization of commodity backstage system
- How to carry out modular power operation efficiently
- Optimization of commodity backstage system
猜你喜欢
Must see! RDS database all in one
异常:Invalid or unexpected token
将Map中对应的key和value赋值到对象中
代码中的软件工程--对menu项目的源码分析
Python提示AttributeError 或者DeprecationWarning: This module was deprecated解决方法
Validation failed for one or more entities. See ‘EntityValidationErrors’解决方法
asp.net Using serilog in core and customizing enrich
How to carry out modular power operation efficiently
Interviewer: what are cache penetration, cache avalanche and cache breakdown?
“wget: 无法解析主机地址”的解决方法
随机推荐
Guest interview: Wang Jian
Software engineering in code -- source code analysis of menu project
异常:Invalid or unexpected token
Top 5 Chinese cloud manufacturers in 2018: Alibaba cloud, Tencent cloud, AWS, telecom, Unicom
Functional guide for temporary users and novices of PL / SQL developer
接缝雕刻算法:一种看似不可能的图像大小调整方法
【CentOS7操作系统安全加固系列】第(2)篇
将Map中对应的key和value赋值到对象中
将Map中对应的key和value赋值到对象中
win7+vs2015+cuda10.2配置TensorRT7.0
算法模板整理(一)
Baishan cloud technology is selected as the top 100 Internet enterprises in China in 2020
Important components of Apache Hadoop
Python中[:]与[::]的用法
SQL filter query duplicate columns
How to greatly improve the performance of larravel framework under php7? Install stone!
CUDA_全局内存及访问优化
Centos7 operating system security hardening series (2)
How much is the cost of CRM system?
Interviewer: what are cache penetration, cache avalanche and cache breakdown?