Giter Club home page Giter Club logo

Comments (5)

fatcerberus avatar fatcerberus commented on August 16, 2024

This is intentional. There are a lot of calls like this that only work in a secure context. If you know your code is always going to run over HTTPS, it would be incredibly annoying and counterproductive if the compiler forced you do either do a null check or add a non-null assertion to every such call.

from typescript.

fatcerberus avatar fatcerberus commented on August 16, 2024

See also #52044 which was marked WAI.

from typescript.

Manish3177 avatar Manish3177 commented on August 16, 2024

Thanks for those links @fatcerberus but in my humble opinion, the "it works in secure context" argument is not much better than a "but it works on my machine" argument. Those that don't care about running in contexts where the property can be null are free to use optional chaining or non-null assertion (if they want to assert they really don't care). A single character isn't counter-productive or something that causes clutter. A false assurance on the other hand is bad for people who care.

from typescript.

fatcerberus avatar fatcerberus commented on August 16, 2024

“but it works on my machine”

This is a bad analogy because HTTP/HTTPS is a server-side concern and not something that would be affected by end-user configuration.

Anyway I’m just telling you the position of the TS maintainers on this - it’s not considered a bug for the reasons stated before and that’s not likely to change.

from typescript.

typescript-bot avatar typescript-bot commented on August 16, 2024

This issue has been marked as "Working as Intended" and has seen no recent activity. It has been automatically closed for house-keeping purposes.

from typescript.

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.