Details
-
Type:
New Feature
-
Status:
Open
-
Priority:
Major
-
Resolution: Unresolved
-
Affects Version/s: None
-
Fix Version/s: None
-
Component/s: JavaScript
-
Labels:None
-
Number of attachments :
Description
function fun() {
function nested() {
x = 42; // which 'x' - local or outer?
}
nested();
print(x); // 42
}
if local, then code should be rewritten as:
function fun() {
var x;
function nested() {
var x = 42;
}
nested();
print(x);
}
if outer, then:
function fun() {
var x;
function nested() {
x = 42;
}
nested();
print(x);
}
See http://google-styleguide.googlecode.com/svn/trunk/javascriptguide.xml?showone=var#var
Issue Links
- depends upon
-
SONARPLUGINS-2541
Symbol table
-
-
SONARPLUGINS-1788
Provide JavaScript rule engine based on SSLR
-