Bug 388332 - [validation] "Module-level" variables are marked as unread
Summary: [validation] "Module-level" variables are marked as unread
Status: NEW
Alias: None
Product: JSDT
Classification: WebTools
Component: General (show other bugs)
Version: unspecified   Edit
Hardware: PC Linux
: P3 minor (vote)
Target Milestone: ---   Edit
Assignee: Project Inbox CLA
QA Contact: Chris Jaun CLA
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-08-29 08:50 EDT by Pierre-Henri Trivier CLA
Modified: 2013-06-19 11:11 EDT (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Pierre-Henri Trivier CLA 2012-08-29 08:50:58 EDT
Greetings

This might be a duplicate of 351470 , must I'm not absolutely sure it's the same situation. 

Steps : 

* Create a JS file with code like this (in the context of a requirejs module):

define(function (require) {

   var Foo = require("path/to/module");

   function Bar() {

      this.foo = new Foo();

   }

   return Bar;
]);

Seen : 

* The variable "Foo" is marked as "Unread". 

Expected : 

* Unless I'm missing something, the variable Foo is defined in the scope of the module, so it's properly accessible in the Bar function ; and the validator should probably not complain. Should it ?
Comment 1 Pierre-Henri Trivier CLA 2012-08-29 08:54:35 EDT
I meant " The variable "Foo" is marked as "Never read" ". Sorry.