Oliver Hunt (2013-11-10T03:49:54.000Z)
domenic at domenicdenicola.com (2013-11-13T17:21:01.456Z)
I think there’s a comment on that page to the effect of “it has to be a string”, i think amazon was one of the sites that interpret the existence of .stack as implying it’s a string. All things being equal i think that i prefer the current Carakan/V8 string format, and would be happy to change JSC’s message to that. As far as eager vs. late creation, I’ve seen - and recall from Java - that people try to get a stack trace with `(new Error).stack`, which i guess is an argument for creation with the error object. On the other hand appending .stack to an arbitrary object on throw means anything can have a stack trace (this is what JSC does). Despite the “yay whatever object i want” advantage, as time has gone by i’ve found myself feeling that appending at Error construction is a better model and would not be opposed to that being the standard. That said the `new Error().stack` or in JSC `try {throw {}}catch(e){e.stack}` (woo concise!) construct is sufficiently common that i think we should provide a decent stack introspection API, as terrible as that idea is :( My main concern with that is that it could expose implementation specific details (though not necessarily as bad as .caller).