New proxy server does not work with features in Chrome

new Proxy(function() {}, {})

Creating a proxy server to view the function does not work in Chrome. Instead, it throws an error:

Uncaught illegal access

I want to look at a function and create a proxy handler when its properties are available. Looks like in Firefox. Any way around this?

+4
source share
2 answers

This is a problem with the Chrome devtools console, which is trying to show the result, not the Proxy constructor itself. What version of Chrome are you using?

In the Chrome 50 console, I see the following:

> let p = new Proxy(function(){return 6},{})
< undefined
> p
< #<Function>
Uncaught illegal access
  DebuggerScript.getFunctionScopes @ (program):4
> p()
< 6

, proxy , barfs . Chrome. .

+5

, @AndreasRossberg Chrome. Firefox, :

> let p = new Proxy(function(){return 6},{})
< undefined
> p
< function ()
> p()
< 6
0

All Articles