Comments (4)
@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.
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.
@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.
👍 Thanks
from node-uwp.
Related Issues (20)
- Incompatibility with nan 2.2.0 HOT 21
- uwp does not work from the REPL HOT 1
- Using this without visual studio HOT 3
- Will this work in Electron shell? HOT 1
- Exceptions swallowed by promises HOT 6
- build: Wrong Windows SDK version HOT 9
- build: missing libs in LINK command line HOT 25
- Unable to use APIs available to real packages HOT 4
- Any way to access MSApp?
- How to get Type definitions for UWP API? HOT 1
- How to List USB device? HOT 1
- UWP Speech recognition
- Error: 404 response downloading https://nodejs.org/dist/v7.0.0-pre8/node-v7.0.0-pre8.tar.gz HOT 14
- Error trying to install the module HOT 2
- Error while installing the module HOT 1
- "Undeclared identifier" error when building with Visual Studio 2015
- Error installing uwp HOT 1
- Cannot install module HOT 1
- How can I use it for NW.js ? HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from node-uwp.