当前位置:网站首页>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
边栏推荐
猜你喜欢

毕业即失业?大学生如何分配学习时间比例,拥有完整计算机知识体系?

On the practical application of C 9's new features

Low power Bluetooth single chip helps Internet of things

mongodb内核源码实现、性能调优、最佳运维实践系列-command命令处理模块源码实现一

day84:luffy:优惠活动策略&用户认证&购物车商品的勾选/结算

11.9

Analysis steps of commodity background management

Realization of commodity backstage system

Python提示AttributeError 或者DeprecationWarning: This module was deprecated解决方法

代码中的软件工程--对menu项目的源码分析
随机推荐
飞鸽传书局域网找不到其他人的问题解决
CUDA常用概念及注意点
IP地址SSL证书
jt-京淘项目
PL/SQL Developer临时用户和新手的功能指南
ERP的权限管理的操作与设计--开源软件诞生24
win7+vs2015+cuda10.2配置TensorRT7.0
[QT] subclass QObject + movetothread to realize multithreading
JT Jingtao project
Quick for imx6ull development board c program call shell
SRM系统是什么系统?SRM供应商管理系统功能
Application of EMQ X in Internet of things platform of China Construction Bank
LeetCode 50 Pow(x,n)
The movie theater booking system based on micro Service Framework
Leetcode 49 letter heterotopic word grouping
Gets the property value of a column in the list collection object
Just graduated will be confused, I after 7 years of summary, give programmers your 7 suggestions
剑指offer之打印二叉搜索树中第k小的结点
Mongodb kernel source code implementation, performance tuning, best operation and maintenance practice series command processing module source code implementation 1
动物园[CSP2020]