Error stack
Mark S. Miller
erights at google.com
Sun Jun 10 17:07:46 PDT 2012
> Oliver Hunt wrote:
>> [...] If you used JSON [...]
On Mon, Jun 11, 2012 at 6:35 AM, Brendan Eich <brendan at mozilla.org> wrote:
> The easy way out is Error.prototype.stackTrace, a getter that exposes,
> deeply and lazily, objects with string and number valued properties cleanly
> reflecting the desired information -- and without any capability leaks.
>
> At this point, perhaps better is better. Any such stackTrace spec should not
> diverge too far from the various .stack implementations, in that one should
> be able to construct the latter from the fomer one true .stackTrace or
> .stackFrames or whatever it must be called.
http://code.google.com/p/google-caja/source/browse/trunk/src/com/google/caja/ses/debug.js#63
getCWStack(err) returns a JSON-able representation, but only to those
that possess the getCWStack function, which is not generally
available, as that would be a bad information leak (though still not a
capability leak). getStack(err) at
http://code.google.com/p/google-caja/source/browse/trunk/src/com/google/caja/ses/debug.js#204
turns this back into a v8-like stack description string, but again
only to those that possess the getStack function (which should be
co-available with getCWStack). The overall debug.js file is a SES shim
for retrofitting this behavior securely onto v8 and, to varying
degrees, other browsers
--
Cheers,
--MarkM
More information about the es-discuss
mailing list