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 Dec 22, 2018 at 12:39
  • Could you provide some sample code we could look at?
    – JF Paradis
    Dec 27, 2018 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, 2018 at 16:26
  • @ymiki Perfect, let us know how we can improve.
    – JF Paradis
    Dec 28, 2018 at 20:12

1 Answer 1


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


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

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .