ES4 draft: Error classes

Michael Daumling mdaeumli at
Fri Mar 7 00:02:08 PST 2008

This may sound like a stupid question, but...

Adding file and line info to an Error instance seems to be a good thing.
Should the standard include two read-only properties "fileName" and
"line" that an implementation may choose to fill in during construction,
and that return, say, the empty string and -1 if not supported?

SpiderMonkey and ExtendScript both support these properties.

-----Original Message-----
From: es4-discuss-bounces at
[mailto:es4-discuss-bounces at] On Behalf Of Lars Hansen
Sent: Thursday, March 06, 2008 5:22 PM
To: es4-discuss Discuss
Subject: ES4 draft: Error classes

The error classes are utterly boring except for the wrinkle that the
predefined subclasses of Error -- EvalError, RangeError, and so on --
all have a [[Class]] that is "Error", not their natural class name.
Anyhow, the draft is enclosed.

Unlike the ES3 spec, I've expanded the subclasses of Error into
individual sections, because I always felt like I had to do a mental
instantiation of what I was reading when I was reading these sections in
the ES3 spec.  (On the other hand, the spec is maybe a percent larger
with the expansion.)


More information about the Es4-discuss mailing list