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.

Bug 121154

Summary: [60cat] CC for array and array element should offer the same items
Product: javascript Reporter: Martin Schovanek <mschovanek>
Component: EditorAssignee: Petr Pisl <ppisl>
Status: NEW ---    
Severity: blocker CC: pjiricka
Priority: P3    
Version: 6.x   
Hardware: All   
OS: All   
Issue Type: ENHANCEMENT Exception Reporter:
Attachments: Different CC lists for x and x[0]

Description Martin Schovanek 2007-11-05 09:22:20 UTC
[#200711041200, jdk1.5.0]

to reproduce:
-------------
1) have .js like:
var x = new Array(2);
x[0]=x;
ERROR: CC for 'x.|' and 'x[0].|' offers different items
Comment 1 Daniel Prusa 2007-11-05 10:33:07 UTC
reproducible
Comment 2 Jiri Kovalsky 2007-11-05 11:56:22 UTC
This issue originated in NetCAT 6.0 program.
Comment 3 Petr Jiricka 2008-02-25 22:46:29 UTC
Fixed in build 682 of NetBeans 6.1.
Comment 4 polan 2008-06-18 14:26:36 UTC
[Build 200806180005, JDK 1.6.0]

CC for 'x.|' and 'x[0].|' still offers different list of possibilities - see attached image.

Or is that a feature?

Reopening...
Comment 5 polan 2008-06-18 14:47:20 UTC
Created attachment 62998 [details]
Different CC lists for x and x[0]
Comment 6 Marek Fukala 2009-04-20 15:44:35 UTC
The array object offers properly Array object type items.

The array element offers just default Object items.

It is impossible to identify the type of the element since it can be defined by some other expression depending on
runtime environment. I admit the type analysis can be done if the index is defined by a number or by a simple expression
and the assignment as well, but this doesn't sound like a bug to me.