closure-linter icon indicating copy to clipboard operation
closure-linter copied to clipboard

Parse error on constructor properties named with underscore when using --jslint_error unused_private_members

Open GoogleCodeExporter opened this issue 10 years ago • 0 comments

What steps will reproduce the problem?
1. Enable lint error "unused_private_members" [--jslint_error 
unused_private_members or --jslint_error all] 
2. Name a constructor property with a trailing underscore [e.g., this.property_]

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

Expected: E:0132: Unused private member: this.property_.

Actual: E:-002: Error parsing file at token "this.property_". Unable to check 
the rest of file.


What version of the product are you using? On what operating system?
closure-linter==2.3.5

Please provide any additional information below.

The following file passes without error using --strict, but results in a parse 
error when "--jslint_error unused_private_members" is enabled. 

/** @constructor */
var Constructor1 = function() {
  this.property1 = 'private_property';
};

var c1 = new Constructor1();

/** @constructor */
var Constructor2 = function() {
  this.property_ = 'private_property';
};

var c2 = new Constructor2();

Original issue reported on code.google.com by [email protected] on 24 Jun 2012 at 4:43

GoogleCodeExporter avatar Jun 17 '15 06:06 GoogleCodeExporter