How LockerService Uses the Proxy Object

LockerService uses the standard JavaScript Proxy object to filter a component’s access to underlying JavaScript objects. The Proxy object ensures that a component only sees DOM elements created by a component in the same namespace.

You can interact with a Proxy object in the same way as you interact with the raw JavaScript object, but the object shows up in the browser’s console as a Proxy. It’s useful to understand LockerService’s usage of Proxy if you drop into your browser’s debugger and start poking around.

When a component creates an intrinsic JavaScript object, LockerService returns the raw JavaScript object. When LockerService filters the object, it returns a Proxy object. Some scenarios where LockerService filters an object and returns a Proxy object are:

When you access these objects, LockerService returns a Proxy object.

For more information about standard JavaScript Proxy object, see the Mozilla Developer Network.