ES5 question: Error object property 'message' - enumerable or not?

Thomas L. Shinnick tshinnic at
Sat Sep 3 11:59:18 PDT 2011

An issue popped up where V8 recently made everything in Error objects 
non-enumerable.  This was surprising to some apps.  More surprising 
is the insistence that this is required by the ES5 spec.

As a simplistic reader, when "own property" is mentioned here new Error (message)

     If the argument message is not undefined, the message own property
     of the newly constructed object is set to ToString(message).

I just naturally think this property it is not supposed to be 
mysteriously unseen.  Yet other general statements in the spec have 
people think everything not explicitly labeled enumerable _can't_ be.    "But the spec 
is the spec"    "...this 
consequence may have been unintended."

Does the ES5 spec intend for 'message' property of Error objects to 
be non-enumerable?

More information about the es-discuss mailing list