From 0c0294d61b0bfc9b8445441ebbb4432774907e5d Mon Sep 17 00:00:00 2001 From: Johannes Ewald Date: Sat, 17 Jan 2015 16:41:02 +0100 Subject: Add note on illegal global variable names --- README.md | 9 +++++++++ 1 file changed, 9 insertions(+) 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**
+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**. +
API -- cgit v1.2.3