Ye olde arguments argument (was: Topic list - pending changes and issues for the ES3.1 spec)

Garrett Smith dhtmlkitchen at gmail.com
Fri Sep 19 14:45:21 PDT 2008


On Fri, Sep 19, 2008 at 6:18 AM, Mike Shaver <mike.shaver at gmail.com> wrote:
> On Fri, Sep 19, 2008 at 12:26 AM, Garrett Smith <dhtmlkitchen at gmail.com> wrote:
>> If a thrown native object did not already have a stack, what is the
>> harm in adding one?
>
> What should be done with a sealed object that's thrown?
>

In EcmaScript, there is [[CanPut]].

5. call [[CanPut]] on THROWN with argument "stack"
6. if Result(5) is false, go to step 11.
...
11. Return (throw, THROWN, empty).

> I'm having trouble reconciling "all thrown objects should have .stack
> thrust upon them, so that all thrown objects expose the site of the
> error" with "but it's OK if that .stack property is really something
> else".
>

I do not understand what you mean. What is the "something else"? If
the stack property exists, it would be a string. What else could it
be?

> Having |throw "msg"| provide an exception which is not a primitive
> string is a straight-out break of the language's semantics; I don't
> think it's feasible at all.  (Mozilla code throws naked numbers all
> over the place, and I suspect would break quite spectacularly if it
> got an Error object instead.)
>

I see.

Thank you,

Garrett

> Mike
>


More information about the Es-discuss mailing list