Status: Started
Owner: erights
Labels: Type-Defect Priority-Medium Client-CajaCapTP Maintainability

New issue 1097 by erights: Cajita throw/catch coercion isn't idempotent
http://code.google.com/p/google-caja/issues/detail?id=1097

Related to issue 1038.

Originally reported by Kevin Reid at http://paste.lisp.org/display/84710

When Cajita code throws and catches a value, it is coerced through
___.tameException. An Error coerces to a frozen record with "name",
"message", and possibly "stack" properties but no other markings. When
vanilla object is throws, such as that record, it is coerced to its printed
form.

We do need coercion to ensure that the caught object is immutable (deeply
frozen) so that it does not leak authority. However, since the only
whitelisted properties of Errors are "name" and "message", which are
apparently already coerced to strings, and Cajita code already can't mutate
these properties. Thus, to Cajita, all Error objects already are
effectively immutable and so should be allowed through by ___.tameException().

If this logic does not hold and we must not pass Errors through for some
reason, then we should at least add a "throwable: true" to the returned
record so it will survive intact if rethrown.

OTOH, if the above logic does hold, we can therefore also make Errors pass
the cajita.isFrozen test, closing out issue 1038 and helping the caja-captp
effort.

--
You received this message because you are listed in the owner
or CC fields of this issue, or because you starred this issue.
You may adjust your issue notification preferences at:
http://code.google.com/hosting/settings

Reply via email to