javascriptbabeljses6-proxy

Can Babel transpile code using Proxy into ES5?


I'm using babelify version 6.3.0 set to stage 0. ES6 / ES7 are working great. However when I try to use JavaScript's proxy functionality:

set product(product={}) {
  this._product = new Proxy({}, {})
}

I get:

ReferenceError: Can't find variable: Proxy

Any ideas?


Solution

  • From the Babel website:

    Due to the limitations of ES5, Proxies cannot be transpiled or polyfilled. See support in various JavaScript engines.