Bug 259023 - Object has "never read" warning even when one of its fields is used
Summary: Object has "never read" warning even when one of its fields is used
Status: RESOLVED FIXED
Alias: None
Product: JSDT
Classification: WebTools
Component: General (show other bugs)
Version: 3.1   Edit
Hardware: PC Windows Vista
: P3 normal (vote)
Target Milestone: 3.0.5   Edit
Assignee: Chris Jaun CLA
QA Contact: Nitin Dahyabhai CLA
URL:
Whiteboard:
Keywords: contributed
: 244323 265818 (view as bug list)
Depends on:
Blocks:
 
Reported: 2008-12-16 16:22 EST by Chris Jaun CLA
Modified: 2011-10-10 09:10 EDT (History)
4 users (show)

See Also:
thatnitind: review+


Attachments
Updates in SingleNameReference (1.23 KB, patch)
2009-04-15 16:09 EDT, Chris Jaun CLA
thatnitind: iplog+
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Chris Jaun CLA 2008-12-16 16:22:30 EST
Build ID: I20081211-1908

Steps To Reproduce:
Type the javascript code....

var myObject = {
    val1: "test1",
    val2: "test2"
};
alert(myObject.val1);

var myObject has the "never read" warning on it.


More information:
Comment 1 Chris Jaun CLA 2009-04-15 16:09:45 EDT
Created attachment 131982 [details]
Updates in SingleNameReference
Comment 2 Chris Jaun CLA 2009-04-15 16:10:49 EDT
In this case we need to check for the case where the local var is a Type and a Local binding.
Comment 3 Nitin Dahyabhai CLA 2009-04-23 01:55:20 EDT
Applied, thanks, Chris.
Comment 4 Chris Jaun CLA 2009-04-29 11:06:13 EDT
*** Bug 244323 has been marked as a duplicate of this bug. ***
Comment 5 Chris Jaun CLA 2009-04-29 13:21:17 EDT
*** Bug 265818 has been marked as a duplicate of this bug. ***
Comment 6 Shedokan CLA 2011-10-10 09:10:24 EDT
It looks like this bug needs to be reopened since I am having the same problem:

var func = function(){
	var self = this;
	self.r = '';
};
func();

I get the "The local variable self is never read" warning about "self", but if I rename the value to anything other than "self" the problem dissappears.

I am using:
Version: Indigo Service Release 1
Build id: 20110916-0149