The LockerService architectural layer enhances security by isolating individual Lightning components in their own containers and enforcing coding best practices.
- LockerService implicitly enables JavaScript ES5 strict mode.
- A component can only traverse the DOM and access elements created by a component in the same namespace. You can’t use
component.find("button1").getElement()
to access the DOM element created by <lightning:button>. - LockerService applies restrictions to global references. LockerService provides secure versions of non-intrinsic objects, such as window. For example, the secure version of window is SecureWindow.
References:
LockerService API Viewer app: http://documentation.auraframework.org/lockerApiTest/index.app?aura.mode=DEV