Talk to me about fixing proxies.

http://codereview.appspot.com/4701044/diff/1/src/com/google/caja/es53.js
File src/com/google/caja/es53.js (right):

http://codereview.appspot.com/4701044/diff/1/src/com/google/caja/es53.js#newcode134
src/com/google/caja/es53.js:134: * Per-object properties:
Perhaps we should divide this list into those that are overridden by
proxies and those which aren't?

http://codereview.appspot.com/4701044/diff/1/src/com/google/caja/es53.js#newcode146
src/com/google/caja/es53.js:146: * {@code obj.v___(p)}
= {@code obj.[[Get]](p)}
Since we check below whether obj.v___ === deferredV, it may be worth
documenting here that this value has that special significance?

http://codereview.appspot.com/4701044/diff/1/src/com/google/caja/es53.js#newcode154
src/com/google/caja/es53.js:154: * {@code obj.freeze___()}
freezes the object; on proxies invokes
Have pe___ and freeze___. Need seal___ as well.

http://codereview.appspot.com/4701044/diff/1/src/com/google/caja/es53.js#newcode216
src/com/google/caja/es53.js:216: // configurable, and the thisect itself
is not extensible.
typo: "thisect". Also below. Due to a "s/obj/this/" ?

http://codereview.appspot.com/4701044/diff/1/src/com/google/caja/es53.js#newcode2751
src/com/google/caja/es53.js:2751: if (!O.HasOwnProperty___(P)) {
The earlier one inlined guestHasOwnProperty for speed. Should this
likewise inline HasOwnProperty___ for speed? Does it no longer need to?

http://codereview.appspot.com/4701044/diff/1/src/com/google/caja/es53.js#newcode3631
src/com/google/caja/es53.js:3631: if (result === void 0) { throw new
TypeError("Unable to freeze."); }
If we move this test into the freeze___ method of proxies, we get to
avoid this test for normal objects.

http://codereview.appspot.com/4701044/diff/1/src/com/google/caja/es53.js#newcode3639
src/com/google/caja/es53.js:3639: throw new TypeError('Only objects may
be frozen.');
Should be "may be made non-extensible"

http://codereview.appspot.com/4701044/diff/1/src/com/google/caja/es53.js#newcode3642
src/com/google/caja/es53.js:3642: if (result === void 0) {
Likewise, we could move this test into the pe___ method of proxies,
saving a test in the normal case.

http://codereview.appspot.com/4701044/diff/3001/src/com/google/caja/es53.js
File src/com/google/caja/es53.js (right):

http://codereview.appspot.com/4701044/diff/3001/src/com/google/caja/es53.js#newcode3561
src/com/google/caja/es53.js:3561: if (!result) { throw new
TypeError('Unable to seal.'); }
Likewise move test to seal___ method of proxies.

http://codereview.appspot.com/4701044/diff/3001/src/com/google/caja/es53.js#newcode4950
src/com/google/caja/es53.js:4950: proxy.freeze___ = proxy.pe___ =
proxy.seal___ = function () {
I don't see how this implements any of the needed semantics beyond
invoking the fix trap.

http://codereview.appspot.com/4701044/

Reply via email to