We have a library we created using ECMACScript 6 that we transpiled using babel that worked perfectly with a VisualForce page. Migrating this library to work with Locker Service I found that Object.freeze is not working. I will like to understand why and know if there is an equivalent way to do this that works with Locker Service.


  • Have you looked at Freeze JavaScript Prototypes – codeyinthecloud Dec 22 '18 at 12:39
  • Could you provide some sample code we could look at? – JF Paradis Dec 27 '18 at 15:41
  • @JFParadis seems in fact it works. Sorry!!! I'm kind of new to Locker Service. It was already hard for me sometimes to understand Lightning Components errors and despite the fact I had years working with Javascript is really hard to debug and understand what is going on. I still had error I know now is not there but will ask once I have a better understanding. Thanks. – ymiki Dec 28 '18 at 16:26
  • @ymiki Perfect, let us know how we can improve. – JF Paradis Dec 28 '18 at 20:12

You can to use the Locker Console to prototype your code:


It's a great way to understand how Locker works.

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.