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 243612

Summary: Add intellisense support for properties created via Object.defineProperty
Product: javascript Reporter: NukemBy
Component: EditorAssignee: Petr Pisl <ppisl>
Status: NEW ---    
Severity: normal    
Priority: P3    
Version: 8.0.1   
Hardware: PC   
OS: Windows XP   
Issue Type: ENHANCEMENT Exception Reporter:
Attachments: No intellisense for Object.defineProperty

Description NukemBy 2014-04-06 19:58:53 UTC
Created attachment 146590 [details]
No intellisense for Object.defineProperty

I'm upgrading to next level with my JavaScript staff :) - trying to adapt native JS support for custom properties. Things work fine at run-time, but intellisense in NetBeans seems to be outdated.

Below is the sample which does not work. I expect NetBeans should be aware about all a, b, c, d members of the TestClass. Unfortunately it knows only 'a'.

Is there something wrong with my sample or this is really not yet supported by NetBeans?

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 

    function TestClass() {
        this.a = 1;
        
        Object.defineProperty(this, "b", {
            get: function () { return "b"; },
            enumerable : true
        });
        
        Object.defineProperties(this, {
            c: {
                get: function () { return "c"; },
                enumerable : true
            }, 
            d: {
                get: function () { return "d"; },
                enumerable : true
            }
        });
    }
    
    var c = new TestClass();
    
    c. // only 'a' is highlighed here :(


- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 

References:

https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/defineProperty

https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/defineProperties
Comment 1 Petr Pisl 2014-04-07 11:13:05 UTC
This is enhancement. This can be also extended with the cc for the property descriptor and offer name of properties like get, enumerable, configurable, value etc ...
Comment 2 Petr Pisl 2014-11-12 12:17:09 UTC
This is not implemented. But it will work, only if the first parameter of the defineProperty method is this and some simple cases.