Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/twbs/rewire.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohannes Ewald <johannes.ewald@peerigon.com>2015-01-17 18:41:02 +0300
committerJohannes Ewald <johannes.ewald@peerigon.com>2015-01-17 18:41:02 +0300
commit0c0294d61b0bfc9b8445441ebbb4432774907e5d (patch)
tree12b2123f1268fb16c97820193e0fbdd95104a8be /README.md
parentad3689f0984df710c382914f56ce38a4fb6ae142 (diff)
Add note on illegal global variable names
Diffstat (limited to 'README.md')
-rw-r--r--README.md9
1 files changed, 9 insertions, 0 deletions
diff --git a/README.md b/README.md
index c0571eb..e02bfc5 100644
--- a/README.md
+++ b/README.md
@@ -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