Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.javascript > #28978 > unrolled thread

Re: Recursively enumerating the global object

Started byThomas 'PointedEars' Lahn <PointedEars@web.de>
First post2015-12-05 10:16 +0100
Last post2015-12-05 10:16 +0100
Articles 1 — 1 participant

Back to article view | Back to comp.lang.javascript

This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by below is the oldest one visible, not the original post.


Contents

  Re: Recursively enumerating the global object Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2015-12-05 10:16 +0100

#28978 — Re: Recursively enumerating the global object

FromThomas 'PointedEars' Lahn <PointedEars@web.de>
Date2015-12-05 10:16 +0100
SubjectRe: Recursively enumerating the global object
Message-ID<1696024.u3LjWGVPF4@PointedEars.de>
Stefan Ram wrote:

> ram@zedat.fu-berlin.de (Stefan Ram) writes:
>>ram@zedat.fu-berlin.de (Stefan Ram) writes:
>>>It worked when I inserted the script into a web page.
>>>Here's the last version:
>>I'd like to show /all/ the information (except function
>>bodies) that can be reached via the global object in
>>Mozilla® Firefox. Please let me know if I still should
>>have missed some information.
> 
>   My code used to produce about 1600 lines, but now it
>   produces a whopping 19000 lines!

You are making the mistake to equate quantity with quality.

>   I remembered that functions are objects too, and now also dump all 
>   functions as object.
> 
>   Finally, a use case for the fall-through in a switch-statement!
>   An excerpt from the current source code (simplified):
> 
> ...
> switch( typeof( arg ))
> {
> 
>   case "function":
>   writeline( path + " = " + t + " : " +( arg.name ? arg.name : "" ));
> 
>   case "object":
>   ...

I commend your efforts (even though I still find your code style suboptimal 
at best).

But you do not realize that you are not the first person to try this, that 
function serialization as such and certainly in advance is not a good idea 
(especially writing out function code in HTML without escaping), and that 
both the built-in script consoles and Firebug provide this information in a 
more user-friendly and context-sensitive way:

Just type the expression, e.g. “Math” and click the result, or type, e.g. 
“inspect(Math)” and see the result in the Inspector pane (right-hand side if 
the console is displayed horizontally, on the bottom if vertically).  Also, 
the console (in single-line mode; Firebug also has a very useful editor 
mode) has auto-completion and tab completion.

<http://devtoolsecrets.com/> (see also the FAQ)

-- 
PointedEars
FAQ: <http://PointedEars.de/faq> | SVN: <http://PointedEars.de/wsvn/>
Twitter: @PointedEars2 | ES Matrix: <http://PointedEars.de/es-matrix>
Please do not cc me. / Bitte keine Kopien per E-Mail.

[toc] | [standalone]


Back to top | Article view | comp.lang.javascript


csiph-web