Search code examples
javascriptgoogle-chromeecmascript-6es6-proxy

Strange ES6 Proxy behaviour on Chrome


I'm running this simple piece of code:

var handler = {
  get(target, prop, proxy) {
    console.log('get', prop);
    return target[prop];
  }
};

var proxy = new Proxy({}, handler);

console.log('the proxy is', proxy);

On Firefox [nightly 46] I get the expected output:

the proxy is Object {  }

However, on Google Chrome [canary 49], some strange things get logged:

the proxy is undefined {}
get splice
get splice
get __proto__

Any idea what's going on here?


Solution

  • Chrome not support yet (Proxy) https://kangax.github.io/compat-table/es6/