Package Exports
- es6-proxy-polyfill
This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (es6-proxy-polyfill) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme
[ 中文 ]
ES6 Proxy Polyfill
This is a polyfill for the Proxy
constructor based on ES3 supports IE8 , Node.js, etc.
Refer to ECMAScript, and this has no external dependencies.
Due to the limitations of ES3, the polyfill supports just a limited number of proxy 'traps':
- apply
- construct
Installation
- Use NPM:
npm install es6-proxy-polyfill
- Download directly: Development Version, Production Version
Usage
- Browser:
<script src="path/to/es6-proxy-polyfill.js" type="text/javascript"></script>
<script type="text/javascript">
var target = function(){/* code */};
var handler = {/* code */};
var proxy = new Proxy(target, handler);
</script>
- Node.js:
require('es6-proxy-polyfill');
var target = function(){/* code */};
var handler = {/* code */};
var proxy = new Proxy(target, handler);
Notice
- In ES6, the access to
Proxy
object's properties will be passed to target. In order to simulate this feature, polyfill will try to copy properties from target by usingObject.assign
method, so it's better to load anObject.assign
polyfill first;
<script src="path/to/babel-polyfill.js" type="text/javascript"></script>
<script src="path/to/es6-proxy-polyfill.js" type="text/javascript"></script>
- The code has been tested on Node.js 0.10.48 and IE8, and it may work in other environments too.