views:

3591

answers:

1

When debugging JavaScript in Visual Studio 2008 and I use the ? command in the command window to list a JavaScript object's members I always get that ellipses {...}. Example:

>? Page_Validators 
{...}
    [0]: {object}
    [1]: {object}
    [2]: {object}
    [3]: {object}
    [4]: {object}
    [5]: {object}
    length: 6

I'm assuming these are the object's member functions. Is there a way to list the members in that {...} ? A one-liner command would be ideal.

Thanks.

+5  A: 

I just tried this and it works, with one caveat:

? (function () { var m = []; for (var p in Page_Validators) { if(typeof Page_Validators[p] == "function") { m.push(p); } } return m; })()

That will show you all of the methods that are part of the object, but none of the built-in inherited methods (like toString() or valueOf()).

Hope that helps.

Jason Bunting
If this works for you and no one offers a better solution, please mark this as the accepted answer; thanks.
Jason Bunting
This still evaluates to {...} in the visual studio command window. I also tried with a few other asp Ajax framework built in objects, static and dynamic, with the same result. I think I had tried this already. Maybe I'm missing something.
eniac
Sorry I was using the code wrong, forgot to change the argument to typeof. does work well:>? (function () { var m = []; for (var p in Sys.Application) { if(typeof Sys.Application[p] == "function") { m.push(p); } } return m; })() {...} [0]: "updated" [1]: "raisePropertyChanged" etcetc
eniac