http://codereview.appspot.com/4701044/diff/29001/src/com/google/caja/es53.js File src/com/google/caja/es53.js (right):
http://codereview.appspot.com/4701044/diff/29001/src/com/google/caja/es53.js#newcode4711 src/com/google/caja/es53.js:4711: return desc.get.f___(safeDis(proxy), []); On 2011/07/20 00:12:02, Mark S. Miller wrote:
Since desc is untrusted (it came from cajoled code), desc.get could be
an
accessor, or desc itself may be a proxy. In either case, the
expression above
for obtaining the value of desc.get is correct, but the obtained value
should be
used here (e.g. "getter.f___(...") rather than asking the same
question twice
and assuming stable answers.
Likewise perhaps at other places below; I haven't checked.
I was surprised to find that the proxies default handlers page actually specified that desc.get and desc.set each be obtained twice, which seems wrong for the above reasons. At http://wiki.ecmascript.org/doku.php?id=harmony:proxies&rev=1310650763&do=diff I revised it to ask each of these once. Tom, does this change seem right to you? Was there a reason other than brevity why the previous code asked each question twice? I notice that this code is prefaced with a disclaimer that it is normative. Where is the normative expression of these default trap behaviors? Does it ask these once or twice? http://codereview.appspot.com/4701044/
