This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.
Created attachment 153325 [details] False-positive-global-variable-not-declared.png I get False-positive warning "The global variable "fn2" is not declared." for invocation of fn2 in this statement "fn2().toLowerCase();". After removing of ".toLowerCase();" warning disappears. See screenshot for details. Occurs in NetBeans IDE Dev (Build 201504230001) - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - /** * @constructor */ var MyLib = new function MyLib() { function fn1() { fn2().toLowerCase(); return ""; } /** * @returns {string} */ function fn2() { return ""; } };
I've got another use-case. Not sure if is the same or different in terms of internal implementation, but complain from NB is the same - The global variable "xxx" is not declared. Appears in line "this.xxx = xxx;" where right-hand-side 'xxx' is reference to local 'var xxx', but is highlighted as 'unknown global'. Running in NetBeans IDE Dev (Build 201505010001) - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - var MyLib = new function MyLib() { var functions = { fn1: function MyLib_fn1(data, id) { var xxx = data[id]; this.xxx = xxx; } }; };
The second case is caused by different problem. I created new issue #252232.
Fixed in web-main.
Integrated into 'main-silver', will be available in build *201505050001* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress) Changeset: http://hg.netbeans.org/main-silver/rev/444bb664761a User: Petr Pisl <ppisl@netbeans.org> Log: #252022 - False-positive warning "The global variable "xxx" is not declared.