Git Product home page Git Product logo

Comments (4)

jianchun avatar jianchun commented on May 10, 2024

@TrevorDev This is partially due to how UWP APIs have been designed and how they are "projected" to JavaScript (see https://msdn.microsoft.com/en-us/library/mt125480(v=vs.94).aspx). The underlying code (not part of this module) creates global "Windows" variable (namespace) and sub-namespaces. These "namespaces" are all non-writable/non-configurable probably for consistency/security reasons. As a result ```var Windows = ..." has no effect. I agree with you that your changed version looks more consistent with node style.

from node-uwp.

TrevorDev avatar TrevorDev commented on May 10, 2024

Thanks for your reply.

Would it be unreasonable to create a feature request for whichever team built that projection function to expose an alternative api to project UWP api's to local variables instead of globals? I am not sure what you mean by "consistency/security reasons" as this is inconsistent with node style and I am also not familiar with windows API security.

I understand that this may be low priority/nitpicking as currently this does not block any functionality but global variables being defined without user explicitly doing so feels like a red flag in many programming environments (not just node) and even feels weird to me when writing a uwp js app and would much prefer a more similar style to http://electron.atom.io/.

from node-uwp.

jianchun avatar jianchun commented on May 10, 2024

@TrevorDev Sorry I didn't have a good answer and didn't reply before you close this issue. By "consistency" I mean consistency with other platforms like c#/JavaScript UWP app. The names and API calls always appear as Windows.xxx.... By "security" I mean it is non-configurable so code cannot replace Windows.xxx with sth. else.

We'll note your feedback and would consider this issue in future development of the UWP/JavaScript projection. Thanks for your comment.

from node-uwp.

TrevorDev avatar TrevorDev commented on May 10, 2024

👍 Thanks

from node-uwp.

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.