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:
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