What is THE global - root context - object in Espruino JS? #345
Replies: 5 comments
-
Posted at 2015-02-10 by alexanderbrevig Have you tried |
Beta Was this translation helpful? Give feedback.
-
Posted at 2015-02-10 by @allObjects this is a runtime value and reference of the current context object... trace takes this to show what is going on for the passed object - and with that it is a relative root. If invoked in root context it will pass in the one I'm looking for, but it does not reveal it's variable name. I'm looking for the absolute root's variable name so I can use it to go after state and behavior (vars/functions) defined in the root context. |
Beta Was this translation helpful? Give feedback.
-
Posted at 2015-02-10 by @gfwilliams As of about 5 minutes ago it's called But before that, there wasn't one. The best equivalent was just to add However, right now |
Beta Was this translation helpful? Give feedback.
-
Posted at 2015-02-10 by @joakim In node.js, each module has its own top-level scope, but they all have access to the http://nodejs.org/api/globals.html#globals_global I think the same would make sense for Espruino, each module having its own scope and the ability to access the global |
Beta Was this translation helpful? Give feedback.
-
Posted at 2015-02-10 by @gfwilliams Ok, that's great - that's what happens right now (only there's no I had seen that page and assumed that the value of |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Posted at 2015-02-10 by @allObjects
This question was asked quite a while ago - it was though triggered by specific challenge and resolved satisfactorily for that need, therefore I'm asking the question again.
What is the root context's variable name? (accessible from within any context?)
In Javascript in a browser, this would be the window object. In @gordon's terminology it is called the root context.
Beta Was this translation helpful? Give feedback.
All reactions