Coder Social home page Coder Social logo

Comments (7)

snovakovic avatar snovakovic commented on July 30, 2024

Freezing of non enumerable properties is available from v3.0.0

Major version has been published because as side effect option to deepFreeze prototype chain has also been removed (braking change). { proto: true } is not longer available because of undesired side effects. For more information on it reference v3.0.0 relese

from js-flock.

astur avatar astur commented on July 30, 2024

{ proto: true } was dangerous but great feature. I'll miss it :)

from js-flock.

snovakovic avatar snovakovic commented on July 30, 2024

I will review it one more time and and consider bringing it back if I find some nice way of avoiding side effects (freezing built in JavaScript objects and their properties).

from js-flock.

astur avatar astur commented on July 30, 2024

As I see these side effects can be avoided by stopping prototype chain on one having constructor property. So we can freeze all properties of prototype objects, but not freeze "prototype classes" (including things like global.Object etc.).

This way if you freeze an array length will be frozen but map will not.

look my get-props for example.

from js-flock.

snovakovic avatar snovakovic commented on July 30, 2024

@astur Thanks for information i will investigate it.

I'm also open to contributions if you want to contribute to it?

from js-flock.

snovakovic avatar snovakovic commented on July 30, 2024

@astur new PR is in preparation that should allow freezing of prototype chain #44.

I still need to do some more testing and maybe some small modifications before merging it in.

If you have time feel free to take a look and comment.

Thanks!

from js-flock.

astur avatar astur commented on July 30, 2024

Looks safe enough. Good.

from js-flock.

Related Issues (14)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.