http://codereview.appspot.com/4701044/diff/13001/src/com/google/caja/es53.js File src/com/google/caja/es53.js (right):
http://codereview.appspot.com/4701044/diff/13001/src/com/google/caja/es53.js#newcode4788 src/com/google/caja/es53.js:4788: names.filter(filter) : On 2011/07/15 04:59:13, Mark S. Miller wrote:
Is filter virtualized?
No to both filters. The method filter is just a method on whatever object handler.getPropertyNames() returns. The function filter is defined immediately above. I also removed the own check in the fastpath. http://codereview.appspot.com/4701044/diff/13001/src/com/google/caja/es53.js#newcode4840 src/com/google/caja/es53.js:4840: validateHandler(handler); On 2011/07/15 04:59:13, Mark S. Miller wrote:
Is this validation in the spec? It doesn't actually provide any hard
safety,
since a handler could mutate itself after validation so that it would
no longer
validate. But this still may be a good idea for catching bugs early.
If so,
perhaps some way to issue a warning or make the validation optional or something? At least a comment to explain why we're deviating from the
spec?
OTOH, for the sake of our own implementation limitation gotcha, we do
need to
validate that proto and all objects it inherits from are not proxies
and are not
extensible.
The spec says "handler is an object that at minimum implements the following API". This check obviously just catches bugs early; the worst that could happen if the handler modifies itself is that it tries to look up a method on the handler and doesn't find it. http://codereview.appspot.com/4701044/diff/13001/src/com/google/caja/es53.js#newcode4841 src/com/google/caja/es53.js:4841: var proxy = {}; On 2011/07/15 04:59:13, Mark S. Miller wrote:
proxy must inherit from proto.
Done. http://codereview.appspot.com/4701044/diff/13001/src/com/google/caja/es53.js#newcode4853 src/com/google/caja/es53.js:4853: return (handler.get_m___ === handler ? On 2011/07/15 04:59:13, Mark S. Miller wrote:
Another mistaken formulation of the _m___ fastpath. Please recheck the
whole
file. I see other occurrences of this problem.
There are no more instances of "_m___ ===". http://codereview.appspot.com/4701044/
