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 - Add intellisense support for properties created via Object.defineProperty
Summary: Add intellisense support for properties created via Object.defineProperty
Status: NEW
Alias: None
Product: javascript
Classification: Unclassified
Component: Editor (show other bugs)
Version: 8.0.1
Hardware: PC Windows XP
: P3 normal (vote)
Assignee: Petr Pisl
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2014-04-06 19:58 UTC by NukemBy
Modified: 2014-11-12 12:17 UTC (History)
0 users

See Also:
Issue Type: ENHANCEMENT
Exception Reporter:


Attachments
No intellisense for Object.defineProperty (23.48 KB, image/png)
2014-04-06 19:58 UTC, NukemBy
Details

Note You need to log in before you can comment on or make changes to this bug.
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.