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


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

Re: Recursively enumerating the global object

Started byThomas 'PointedEars' Lahn <PointedEars@web.de>
First post2015-12-02 06:52 +0100
Last post2015-12-02 06:52 +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-02 06:52 +0100

#28936 — Re: Recursively enumerating the global object

FromThomas 'PointedEars' Lahn <PointedEars@web.de>
Date2015-12-02 06:52 +0100
SubjectRe: Recursively enumerating the global object
Message-ID<8697390.cdeR94Mu09@PointedEars.de>
Stefan Ram wrote:

> ram@zedat.fu-berlin.de (Stefan Ram) writes:
>>But why doesn't it find »(G).Math.PI«? When I type in
>>»this.Math.PI«, it is evaluated as intended:
> 
>   It seems that the script was interrupted by an error,
>   and that error might have been caused by the fact that
>   no HTML page was loaded in the browser when I pasted
>   the script into the console.

That is how far you review all your actions, is it not?  “Might have been 
caused”…

document.write() has never been suitable for debugging from the *console*, 
because document.write() after the document has been loaded overwrites it in 
memory/viewport in an unsafe fashion (there should be document.open() before 
and document.close() afterwards); hence window.alert() and console.log(…).

>   It worked when I inserted the script into a web page.
>   Here's the last version:
> […]

If only it were not your usual unreadable, undertested junk.

That said, Object.get*Own*PropertyNames() and Array.prototype.forEach() have 
been introduced with ECMAScript Edition 5 at the earliest (some 
implementations probably had it before it was in the Specification), and 
does not suffice for enumerating the properties of objects.

-- 
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