Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit0c0294d

Browse files
committed
Add note on illegal global variable names
1 parentad3689f commit0c0294d

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

‎README.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -151,6 +151,15 @@ Be careful, if you do something like this you'll change your global console inst
151151
myModule.__set__("console.log",function () {/* be quiet*/ });
152152
```
153153

154+
**Globals with invalid variable names**<br>
155+
rewire imports global variables into the local scope by prepending a list of`var` declarations:
156+
157+
```javascript
158+
var someGlobalVar=global.someGlobalVar;
159+
```
160+
161+
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**.
162+
154163
<br />
155164

156165
API

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp