for-in statement: null and undefined

Allen Wirfs-Brock Allen.Wirfs-Brock at
Thu Jul 3 20:43:57 PDT 2008

We'll look into it for ES3.1.  It sounds like it's something we've overlook that meets our criteria for changes that reflect web reality. It's possible we might want to leave the exception in for our cautious (ie strict) subset.

-----Original Message-----
From: es4-discuss-bounces at [mailto:es4-discuss-bounces at] On Behalf Of Kent Hansen
Sent: Thursday, July 03, 2008 8:43 AM
To: Es3.x-discuss at; es4-discuss at
Subject: for-in statement: null and undefined

In the current public ES4 reference implementation [1], iterating over
null and undefined is a no-op instead of a TypeError, which is in line
with the proposal at [2] (which points out that existing web browsers
already do this). However, the most recent ES3.1 draft [3] does not
incorporate this change. It's not mentioned in Douglas Crockford's
recommendations for modifications to ES [4] either, nor in the proposed
incompatibilities [5]. So my question is, will this change be part of
ES3.1 or not (doesn't it have to, for ES4 compatibility's sake)? I can't
find a discussion of this issue anywhere.

By the way, in the ES4 reference implementation, iterating over strings
is a no-op as well; implementation bug, or are string properties not
enumerable in ES4? "X".hasOwnProperty(0) returns false, too.


Es4-discuss mailing list
Es4-discuss at

More information about the Es4-discuss mailing list