---
schema_version: "1"
id: fc3694b8369b4cfeba32790148e5a25951fba4dc3e3f64e77d60f85154804151
title: Evaluate JavaScript Code Compatibility with Lightning Locker
collection: developer
version: current
locale: en-us
portal_url: https://docs.salesforce.com/developer/current/en-us/lwc/lightning-components-security/guides/locker/locker-console-evaluate.md
canonical_url: https://developer.salesforce.com/docs/platform/lightning-components-security/guide/locker-console-evaluate.html
source_site: developer.salesforce.com
content_type: documentation
content_hash: 54f3ef422b135fbb7207d692a4ad55cba387939c215e7a26a816e27fef77ed81
products:
  - Security for Lightning Components
  - lwc
---
# Evaluate JavaScript Code Compatibility with Lightning Locker

Ensure that your code is compatible with Lightning Locker by running the code with Locker enabled. Run the code a second time with Locker disabled to see if any errors are due to Lightning Locker restrictions.

Let's look at an example that uses a prohibited DOM API.

1. Paste this code into the console.

   ```javascript
   var controller = new AbortController();
   controller;
   ```

2. Click **Evaluate**.

   Note the error in the LOCKER ON column of the results window.

   ```
   Error: AbortController is not a constructor
   ```

   You get this error because `AbortController` is an experimental interface in the DOM API and is not allowed by Lightning Locker.

   The LOCKER OFF column shows N/A as this column isn't relevant when the Locker toggle is enabled.

3. Click the **Locker** toggle to disable Lightning Locker.

4. Click **Evaluate** to rerun the code sample with Lightning Locker disabled.

   The second row of the results window shows there's no longer an error when Lightning Locker is disabled. The LOCKER OFF column shows [object AbortController], which is the return value of the sample code.

   ![Locker Console Example with prohibited DOM API.](https://developer.salesforce.com/media/locker_console_evaluate.png '{"class": "image-framed", "title": "Locker Console Example with prohibited DOM API"}')

Use the Locker API Viewer to see the DOM APIs exposed by Lightning Locker versus the standard DOM APIs for the most complex wrappers: `SecureDocument`, `SecureElement`, and `SecureWindow`.

**See Also**

- [Locker Console Overview](https://developer.salesforce.com/docs/platform/lightning-components-security/guide/locker-console.md)
- [Lightning Locker API Viewer Overview](https://developer.salesforce.com/docs/platform/lightning-components-security/guide/locker-api-viewer.md)
