# es6-proxy-polyfill
**Repository Path**: ambit/es6-proxy-polyfill
## Basic Information
- **Project Name**: es6-proxy-polyfill
- **Description**: ES6 Proxy 兼容库,支持 IE8+ 和 Node.js 等
- **Primary Language**: JavaScript
- **License**: Apache-2.0
- **Default Branch**: v2
- **Homepage**: None
- **GVP Project**: No
## Statistics
- **Stars**: 23
- **Forks**: 6
- **Created**: 2018-08-27
- **Last Updated**: 2024-10-14
## Categories & Tags
**Categories**: javascript-toolkits
**Tags**: None
## README
简体中文 | [English](https://github.com/ambit-tsai/es6-proxy-polyfill#readme)
# ES6 Proxy Polyfill 
一个 ES6 `Proxy` 的兼容库,支持 **IE6+** 和 Node.js 等。
迄今为止,它支持比 GoogleChrome proxy-polyfill 更多的特性。
该 polyfill 只支持有限的 'trap' 代理:
* get
* set
* apply
* construct
`Proxy.revocable` 方法也被支持,但只限于调用上面的 'trap' 。
#### 安装
```javascript
npm i -S es6-proxy-polyfill
```
#### 用法
1. 浏览器:
```html
```
2. Node.js:
```javascript
var Proxy = require('es6-proxy-polyfill');
var proxy = new Proxy({}, {});
```
#### 注意
1. 对于**非数组**对象,想要代理的属性**必须在创建时就已存在**;
1. 在 IE8 及以下,它依赖于 "object-defineproperty-ie" 库提供的 `Object.defineProperties` 与 `Object.getOwnPropertyDescriptor`;
1. Trap 的支持情况:
||对象|函数|数组|
|:-:|:-:|:-:|:-:|
|>=IE9|get, set|get, set, apply, construct|get, set|
|<=IE8|get, set|apply, construct|-|
#### 测试
1. 使用浏览器访问 `test/browser/index.html`
1. 已在 IE6-8、IE11 中进行测试
#### 联系
1. 微信: ambit_tsai
1. QQ群: 663286147
1. 邮箱: ambit_tsai@qq.com