threeapples307 / closure-linter

Automatically exported from code.google.com/p/closure-linter
Apache License 2.0
0 stars 0 forks source link

Catch invalid usage of dot notation #52

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. I write some code that looks like this:
var a = {'b': 'c'};
a.b = 'd';
alert(a.b); // will print out 'c'
2. The minifier converts the key 'b' into something else when the dot notation 
is used to access it.
3. The alert doesn't work as expected, because in the second line, 'b' has been 
renamed.
4. The closure linter does not warn me that I'm using the improper dot-syntax.

What is the expected output? What do you see instead?
I expected the closure linter to warn me that I was making a mistake. It did 
not.

What version of the product are you using? On what operating system?
Mac OS X. I'm using the following linter:
http://code.google.com/p/closure-linter/source/browse/trunk/closure_linter/fixjs
style.py?r=4

Please provide any additional information below.

Original issue reported on code.google.com by am...@airtime.com on 15 Aug 2012 at 8:41

GoogleCodeExporter commented 9 years ago
This is not something the linter can handle. Instead this should be a compiler 
warning.

Original comment by rum...@google.com on 15 Jan 2015 at 8:54