diff options
author | Johannes Ewald <johannes.ewald@peerigon.com> | 2015-01-17 18:41:02 +0300 |
---|---|---|
committer | Johannes Ewald <johannes.ewald@peerigon.com> | 2015-01-17 18:41:02 +0300 |
commit | 0c0294d61b0bfc9b8445441ebbb4432774907e5d (patch) | |
tree | 12b2123f1268fb16c97820193e0fbdd95104a8be /README.md | |
parent | ad3689f0984df710c382914f56ce38a4fb6ae142 (diff) |
Add note on illegal global variable names
Diffstat (limited to 'README.md')
-rw-r--r-- | README.md | 9 |
1 files changed, 9 insertions, 0 deletions
@@ -151,6 +151,15 @@ Be careful, if you do something like this you'll change your global console inst myModule.__set__("console.log", function () { /* be quiet */ }); ``` +**Globals with invalid variable names**<br> +rewire imports global variables into the local scope by prepending a list of `var` declarations: + +```javascript +var someGlobalVar = global.someGlobalVar; +``` + +If `someGlobalVar` is not a valid variable name, rewire just ignores it. **In this case you're not able to override the global variable locally**. + <br /> API |