Except for the issue below, especially the things that trigger a fix trap, LGTM. I'll be in this afternoon. Let's go over pe___, seal___, and freeze___ in person.
http://codereview.appspot.com/4701044/diff/49001/src/com/google/caja/es53.js File src/com/google/caja/es53.js (right): http://codereview.appspot.com/4701044/diff/49001/src/com/google/caja/es53.js#newcode4927 src/com/google/caja/es53.js:4927: result.DefineOwnProperty___(names[i], { enumerable: true }); 'names' is untrusted (it was obtained from an untrusted handler). But the code here assumes that names[i] is the same value that was just validated by "assertValidPropertyName(names[i]);" above. http://codereview.appspot.com/4701044/diff/49001/src/com/google/caja/es53.js#newcode4956 src/com/google/caja/es53.js:4956: delete proxy.fixing___; Since the "throw new TypeError" on the following line can be caught by an untrusted handler, I'm suspicious of this deletion. Rather, I think this flag should only be deleted by unwinding the original setting of the flag, below. If the semantics says otherwise, please let me know. It may be a bug in the semantics. http://codereview.appspot.com/4701044/diff/49001/src/com/google/caja/es53.js#newcode4963 src/com/google/caja/es53.js:4963: delete proxy.fixing___; I suspect we need to put the fix call above into the try block of a try/finally and put this delete into its finally block. http://codereview.appspot.com/4701044/diff/49001/src/com/google/caja/es53.js#newcode4968 src/com/google/caja/es53.js:4968: delete proxy[i]; This delete will fail for any i that aren't own properties of the proxy. In non-strict code, that's technically ok, but it would be good for ES5/3 to be compatible with strict. For that reason as well as general clarity, we should guard this with an own check. http://codereview.appspot.com/4701044/diff/49001/src/com/google/caja/es53.js#newcode4976 src/com/google/caja/es53.js:4976: return proxy; The initiaization of the proxy from the descMap looks good. But for pe___ you need to then set the ne___ flag. For seal___ and freeze___, you additionally need to seal and freeze it. http://codereview.appspot.com/4701044/
