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


Groups > comp.lang.javascript > #28936

Re: Recursively enumerating the global object

Path csiph.com!news.mixmin.net!weretis.net!feeder1.news.weretis.net!news.solani.org!.POSTED!not-for-mail
From Thomas 'PointedEars' Lahn <PointedEars@web.de>
Newsgroups comp.lang.javascript
Subject Re: Recursively enumerating the global object
Date Wed, 02 Dec 2015 06:52:31 +0100
Organization PointedEars Software (PES)
Lines 35
Message-ID <8697390.cdeR94Mu09@PointedEars.de> (permalink)
References <global-20151202015022@ram.dialup.fu-berlin.de> <global-dump-20151202024621@ram.dialup.fu-berlin.de>
Reply-To Thomas 'PointedEars' Lahn <cljs@PointedEars.de>
Mime-Version 1.0
Content-Type text/plain; charset="UTF-8"
Content-Transfer-Encoding 8Bit
X-Trace solani.org 1449037050 21183 eJwFwYEBgDAIA7CXWh0g50AZ/59gYq/TFcfNj60tqbGovAvPyy0aZg7Rqu6HDaUmHNI3oH4q5RHN (2 Dec 2015 06:17:30 GMT)
X-Complaints-To abuse@news.solani.org
NNTP-Posting-Date Wed, 2 Dec 2015 06:17:30 +0000 (UTC)
User-Agent KNode/4.14.2
X-User-ID eJwNysERACEIBLCWVGDBcoA9+i/h/GZigo12hUFtbKrXdK1noTFTKTZ3UgknsV0oHkEeZVfludvf7McZ9cF+ftgWig==
Cancel-Lock sha1:YuxgDC66PMs2P/ymVnR3+5sJaIg=
X-NNTP-Posting-Host eJwNxckBwDAIA7CZOGzoOATI/iOk+ghGYYcTdFzcs6PYibJu2WX/mWhoTdIlaVHYPgv3+DQfNqwRYQ==
Xref csiph.com comp.lang.javascript:28936

Show key headers only | View raw


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.

Back to comp.lang.javascript | Previous | Next | Find similar | Unroll thread


Thread

Re: Recursively enumerating the global object Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2015-12-02 06:52 +0100

csiph-web