Code Monkey home page Code Monkey logo

Comments (2)

caridy avatar caridy commented on August 15, 2024
Object.getOwnPropertyDescriptor(window, 'chrome')
{value: {}, writable: true, enumerable: true, configurable: false}

This is not problematic because even though it is non-configurable, it is writable, therefore we can replace the value with undefined (in the case of SES), or with a Proxy in the case of our use-case.

/cc @erights @jdalton

from near-membrane.

jfparadis avatar jfparadis commented on August 15, 2024

The issue I raised is a little different, and it's due to the fact that window.chrome can't be removed, which means that:

  • typeof chrome === 'undefined' fails
  • an accidental global can't be detected with a ReferenceError.

In addition, this global is unspecified API, and it's pure luck that it can be nullified. This is a great canari alerting to a problem...

The language specs should include an invariant to at least maintain status quo on the current non-configurable objects (better, make them configurable), but more importantly prevent other objects to appear as non-configurable or non-writable!

from near-membrane.

Related Issues (20)

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.