threeapples307 / closure-linter

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

AttributeErrors (Patch with fix) #79

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. Be a poor, starving freelancer
2. Have to fix some mangled inline JS
3. Run gjslint --check_html -r static/html

What is the expected output? What do you see instead?

Expected output containing full error list. Instead AttributeError is thrown 
due to token and metadata objects being set to None

What version of the product are you using? On what operating system?

gjslint v2.3.12 on Arch Linux

Please provide any additional information below.

I have encountered some pretty badly mangled inline JS in my current job, which 
is NDA so I can't provide any test case (sorry) but attached is a patch that 
fixed the problem for me. It seems to pass full_test without issue. Otherwise 
though this linter saved my sanity. Thanks Google.

Original issue reported on code.google.com by seriousl...@gmail.com on 8 Nov 2013 at 2:25

Attachments:

GoogleCodeExporter commented 9 years ago
Thanks seriouslagg for sharing the issue and the patch.

If you can share the code for repro (ofcourse not the actual proprietary code 
but some sample representative code which can reproduce the issue with just the 
offending styling and dummy logic) then it can be added in the test suite to 
avoid regression.

Original comment by vagra...@google.com on 12 Nov 2013 at 6:18

GoogleCodeExporter commented 9 years ago
Over the past few days I've been trying to produce a usable testcase for
this purpose, but unfortunately I have yet to strip it down in a way that
both reproduces the error and doesn't violate the terms of the agreement.
It's related to syntax in the files themselves used for preprocessing that
chokes up gjslint. I'll see what can be done about writing a testcase from
scratch.

Original comment by seriousl...@gmail.com on 12 Nov 2013 at 9:32

GoogleCodeExporter commented 9 years ago
Attached is a patch that adds the unit test.

Original comment by seriousl...@gmail.com on 12 Nov 2013 at 10:43

Attachments: