ES6 and Error Object properties

Patrick Mueller pmuellr at yahoo.com
Wed Nov 4 11:39:22 PST 2009


Coincidently, I posted a blog entry on SyntaxError and eval() yesterday:

	http://pmuellr.blogspot.com/2009/11/evil-eval.html

On Nov 4, 2009, at 11:10 AM, Kevin Curtis wrote:

> This has probably been chewed over but -
>
> The ES5 spec defines 'name' and 'message' as properties of the Error -
> and ReferenceError, SyntaxError etc - objects.
>
> Currently engines have useful additional non-standard properties:
> Mozilla - fileName, lineNumber and stack.
> V8 - stack (and type, arguments). (The string returned by 'stack' is
> not in the same format as Mozilla).
> JSC - line, sourceId, sourceURL, expressionBeginOffset,
> expressionCaretOffset ,expressionEndOffset - and a few others for
> Statement errors.
>
>
> Any chance for ES6 on standardizing Error object property/ies which
> report back the error location.
>
> Maybe a property 'location' on the Error object which returns an  
> object. e.g
> e.location ->
> {fileName:<filename>, pos: <character posNumber>, line:<lineNumber> ,
> lineEnd:<lineNumber>, col:<colNumber> , colEnd:<colNumber>, stack:
> <stackString>}
>
> With maybe pos and line being mandatory properties and the other
> properties set if they can be set.
>

Patrick Mueller - http://muellerware.org/






More information about the es-discuss mailing list