Harmonious Proxies and WeakMaps. (issue2225043)

3 views
Skip to first unread message

meta...@gmail.com

unread,
Sep 23, 2010, 4:56:02 PM9/23/10
to eri...@gmail.com, st...@google.com, google-ca...@googlegroups.com, re...@codereview.appspotmail.com

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

http://codereview.appspot.com/2225043/diff/10001/src/com/google/caja/es53.js#newcode47
src/com/google/caja/es53.js:47: Object.prototype.hasOwnProperty___ =
Object.prototype.hasOwnProperty;
I think the reversion from virtualize should happen as a separate
change, since it applies to so much of the file.

http://codereview.appspot.com/2225043/diff/10001/src/com/google/caja/es53.js#newcode177
src/com/google/caja/es53.js:177: var edIndex = aguments[2];
Bug in my code: edIndex should be endIndex

http://codereview.appspot.com/2225043/diff/10001/src/com/google/caja/es53.js#newcode751
src/com/google/caja/es53.js:751: // Is there any reason even to log
these? They are many, and
There shouldn't be any; where are you seeing them? I was getting errors
due to accidentally taming something in two ways, so I put this in.

http://codereview.appspot.com/2225043/diff/10001/src/com/google/caja/es53.js#newcode921
src/com/google/caja/es53.js:921: // ES-Harmony proposal
Include a link to the proposal

http://codereview.appspot.com/2225043/diff/10001/src/com/google/caja/es53.js#newcode1443
src/com/google/caja/es53.js:1443: proxy['ne___'] = false,
Here and below, use . instead of ['...']

http://codereview.appspot.com/2225043/diff/10001/src/com/google/caja/es53.js#newcode1459
src/com/google/caja/es53.js:1459: if (typeof trap === 'function') {
What about regexps?

http://codereview.appspot.com/2225043/diff/10001/src/com/google/caja/es53.js#newcode1611
src/com/google/caja/es53.js:1611: proxy[p] = v;
Did you mean to return here?

http://codereview.appspot.com/2225043/diff/10001/src/com/google/caja/es53.js#newcode3155
src/com/google/caja/es53.js:3155: var P = names[i];
yikes! good catch

http://codereview.appspot.com/2225043/

eri...@google.com

unread,
Sep 24, 2010, 12:59:10 AM9/24/10
to eri...@gmail.com, meta...@gmail.com, st...@google.com, google-ca...@googlegroups.com, re...@codereview.appspotmail.com

http://codereview.appspot.com/2225043/diff/10001/src/com/google/caja/es53.js#newcode47
src/com/google/caja/es53.js:47: Object.prototype.hasOwnProperty___ =
Object.prototype.hasOwnProperty;

On 2010/09/23 20:56:02, metaweta wrote:
> I think the reversion from virtualize should happen as a separate
change, since
> it applies to so much of the file.

Done.

http://codereview.appspot.com/2225043/diff/10001/src/com/google/caja/es53.js#newcode177
src/com/google/caja/es53.js:177: var edIndex = aguments[2];

On 2010/09/23 20:56:02, metaweta wrote:
> Bug in my code: edIndex should be endIndex

And aguments should be arguments. On the same line and we both missed
it!

Done.

http://codereview.appspot.com/2225043/diff/10001/src/com/google/caja/es53.js#newcode751
src/com/google/caja/es53.js:751: // Is there any reason even to log
these? They are many, and

On 2010/09/23 20:56:02, metaweta wrote:
> There shouldn't be any; where are you seeing them? I was getting
errors due to
> accidentally taming something in two ways, so I put this in.

I don't remember. I'll instrument and re-run until I reproduce this. Or
I'll revert.

On 2010/09/23 20:56:02, metaweta wrote:
> Include a link to the proposal

Done.

On 2010/09/23 20:56:02, metaweta wrote:
> Here and below, use . instead of ['...']

Weird. I don't know why I did it that way.

Done.

http://codereview.appspot.com/2225043/diff/10001/src/com/google/caja/es53.js#newcode1459
src/com/google/caja/es53.js:1459: if (typeof trap === 'function') {

On 2010/09/23 20:56:02, metaweta wrote:
> What about regexps?

Added a TODO. Will get back to this. I think Tom's right -- the
fundamental traps should error instead of defaulting.

On 2010/09/23 20:56:02, metaweta wrote:
> Did you mean to return here?

I did indeed. Done.

http://codereview.appspot.com/2225043/

Mark S. Miller

unread,
Sep 25, 2010, 11:28:23 PM9/25/10
to eri...@gmail.com, meta...@gmail.com, st...@google.com, google-ca...@googlegroups.com, re...@codereview.appspotmail.com
On Thu, Sep 23, 2010 at 9:59 PM, <eri...@google.com> wrote:
http://codereview.appspot.com/2225043/diff/10001/src/com/google/caja/es53.js#newcode751
src/com/google/caja/es53.js:751: // Is there any reason even to log
these? They are many, and
On 2010/09/23 20:56:02, metaweta wrote:
There shouldn't be any; where are you seeing them?  I was getting
errors due to
accidentally taming something in two ways, so I put this in.

I don't remember. I'll instrument and re-run until I reproduce this. Or
I'll revert.

The reason you weren't seeing these dups was that your previous line
    fn.f___ !== fn.apply
was buggy. After I corrected to
    fn.f___ === fn.apply
I saw the error. When I change the error report to simply logging dups, I see trace shown below.

The reason for this is apparently that domita.js exportFields and applyAccessors will use the same function multiple times as getters and setters, i.e., as arguments to ___.useGetHandler and ___.useSetHandler. AFAICT, there's nothing wrong with that, so I'm preserving the absence of a diagnostic for this case. I will leave in an explanatory comment citing this email.
 

Already tamed: function writeln(html) { tameDocWrite(concat(arguments), "\n"); }
Already tamed: function write(html_varargs) { var htmlText = concat(arguments); if (!insertionPoint) { insertionPoint = base; } var lexer = html.makeSaxParser(documentWriter); lexer(htmlText); }
Already tamed: function () { return tameDocument.body___.clientWidth; }
Already tamed: function () { return tameDocument.body___.clientHeight; }
Already tamed: function () { return tameDocument.body___.clientWidth; }
Already tamed: function () { return tameDocument.body___.clientHeight; }
Already tamed: function propertyOnlyHasGetter(_) { throw new TypeError("setting a property that only has a getter"); }
Already tamed: function () { return tameDocument.body___.scrollWidth; }
Already tamed: function propertyOnlyHasGetter(_) { throw new TypeError("setting a property that only has a getter"); }
Already tamed: function () { return tameDocument.body___.scrollWidth; }
Already tamed: function propertyOnlyHasGetter(_) { throw new TypeError("setting a property that only has a getter"); }
Already tamed: function () { return tameDocument.body___.scrollWidth; }
Already tamed: function propertyOnlyHasGetter(_) { throw new TypeError("setting a property that only has a getter"); }
Already tamed: function propertyOnlyHasGetter(_) { throw new TypeError("setting a property that only has a getter"); }
Already tamed: function () { return tameDocument.body___.scrollHeight; }
Already tamed: function propertyOnlyHasGetter(_) { throw new TypeError("setting a property that only has a getter"); }
Already tamed: function () { return tameDocument.body___.scrollHeight; }
Already tamed: function propertyOnlyHasGetter(_) { throw new TypeError("setting a property that only has a getter"); }
Already tamed: function () { return tameDocument.body___.scrollHeight; }
Already tamed: function propertyOnlyHasGetter(_) { throw new TypeError("setting a property that only has a getter"); }
Already tamed: function (y) { tameDocument.body___.scrollTop = + y; return y; }
Already tamed: function () { return tameDocument.body___.scrollTop; }
Already tamed: function (y) { tameDocument.body___.scrollTop = + y; return y; }
Already tamed: function () { return tameDocument.body___.scrollTop; }
Already tamed: function (y) { tameDocument.body___.scrollTop = + y; return y; }
Already tamed: function () { return tameDocument.body___.scrollTop; }
Already tamed: function (x) { tameDocument.body___.scrollLeft = + x; return x; }
Already tamed: function () { return tameDocument.body___.scrollLeft; }
Already tamed: function (x) { tameDocument.body___.scrollLeft = + x; return x; }
Already tamed: function () { return tameDocument.body___.scrollLeft; }
Already tamed: function (x) { tameDocument.body___.scrollLeft = + x; return x; }
Already tamed: function () { return tameDocument.body___.scrollLeft; }
Already tamed: function propertyOnlyHasGetter(_) { throw new TypeError("setting a property that only has a getter"); }
Already tamed: function () { return tameDocument.body___.scrollTop; }
Already tamed: function propertyOnlyHasGetter(_) { throw new TypeError("setting a property that only has a getter"); }
Already tamed: function () { return tameDocument.body___.scrollTop; }
Already tamed: function propertyOnlyHasGetter(_) { throw new TypeError("setting a property that only has a getter"); }
Already tamed: function () { return tameDocument.body___.scrollTop; }
Already tamed: function propertyOnlyHasGetter(_) { throw new TypeError("setting a property that only has a getter"); }
Already tamed: function propertyOnlyHasGetter(_) { throw new TypeError("setting a property that only has a getter"); }
Already tamed: function () { return tameDocument.body___.scrollLeft; }
Already tamed: function propertyOnlyHasGetter(_) { throw new TypeError("setting a property that only has a getter"); }
Already tamed: function () { return tameDocument.body___.scrollLeft; }
Already tamed: function propertyOnlyHasGetter(_) { throw new TypeError("setting a property that only has a getter"); }
Already tamed: function () { return tameDocument.body___.scrollLeft; }
Already tamed: function propertyOnlyHasGetter(_) { throw new TypeError("setting a property that only has a getter"); }
Already tamed: function propertyOnlyHasGetter(_) { throw new TypeError("setting a property that only has a getter"); }
Already tamed: function () { return tameDocument.body___.offsetWidth; }
Already tamed: function propertyOnlyHasGetter(_) { throw new TypeError("setting a property that only has a getter"); }
Already tamed: function () { return tameDocument.body___.offsetWidth; }
Already tamed: function propertyOnlyHasGetter(_) { throw new TypeError("setting a property that only has a getter"); }
Already tamed: function () { return tameDocument.body___.offsetWidth; }
Already tamed: function propertyOnlyHasGetter(_) { throw new TypeError("setting a property that only has a getter"); }
Already tamed: function propertyOnlyHasGetter(_) { throw new TypeError("setting a property that only has a getter"); }
Already tamed: function () { return tameDocument.body___.offsetHeight; }
Already tamed: function propertyOnlyHasGetter(_) { throw new TypeError("setting a property that only has a getter"); }
Already tamed: function () { return tameDocument.body___.offsetHeight; }
Already tamed: function propertyOnlyHasGetter(_) { throw new TypeError("setting a property that only has a getter"); }
Already tamed: function () { return tameDocument.body___.offsetHeight; }
Already tamed: function propertyOnlyHasGetter(_) { throw new TypeError("setting a property that only has a getter"); }
Already tamed: function propertyOnlyHasGetter(_) { throw new TypeError("setting a property that only has a getter"); }
Already tamed: function () { return tameDocument.body___.offsetTop; }
Already tamed: function propertyOnlyHasGetter(_) { throw new TypeError("setting a property that only has a getter"); }
Already tamed: function () { return tameDocument.body___.offsetTop; }
Already tamed: function propertyOnlyHasGetter(_) { throw new TypeError("setting a property that only has a getter"); }
Already tamed: function () { return tameDocument.body___.offsetTop; }
Already tamed: function propertyOnlyHasGetter(_) { throw new TypeError("setting a property that only has a getter"); }
Already tamed: function propertyOnlyHasGetter(_) { throw new TypeError("setting a property that only has a getter"); }
Already tamed: function () { return tameDocument.body___.offsetLeft; }
Already tamed: function propertyOnlyHasGetter(_) { throw new TypeError("setting a property that only has a getter"); }
Already tamed: function () { return tameDocument.body___.offsetLeft; }
Already tamed: function propertyOnlyHasGetter(_) { throw new TypeError("setting a property that only has a getter"); }
Already tamed: function () { return tameDocument.body___.offsetLeft; }
Already tamed: function propertyOnlyHasGetter(_) { throw new TypeError("setting a property that only has a getter"); }
Already tamed: function propertyOnlyHasGetter(_) { throw new TypeError("setting a property that only has a getter"); }
Already tamed: function () { return tameDocument.body___.clientWidth; }
Already tamed: function propertyOnlyHasGetter(_) { throw new TypeError("setting a property that only has a getter"); }
Already tamed: function () { return tameDocument.body___.clientWidth; }
Already tamed: function propertyOnlyHasGetter(_) { throw new TypeError("setting a property that only has a getter"); }
Already tamed: function () { return tameDocument.body___.clientWidth; }
Already tamed: function propertyOnlyHasGetter(_) { throw new TypeError("setting a property that only has a getter"); }
Already tamed: function propertyOnlyHasGetter(_) { throw new TypeError("setting a property that only has a getter"); }
Already tamed: function () { return tameDocument.body___.clientHeight; }
Already tamed: function propertyOnlyHasGetter(_) { throw new TypeError("setting a property that only has a getter"); }
Already tamed: function () { return tameDocument.body___.clientHeight; }
Already tamed: function propertyOnlyHasGetter(_) { throw new TypeError("setting a property that only has a getter"); }
Already tamed: function () { return tameDocument.body___.clientHeight; }
Already tamed: function propertyOnlyHasGetter(_) { throw new TypeError("setting a property that only has a getter"); }
Already tamed: function propertyOnlyHasGetter(_) { throw new TypeError("setting a property that only has a getter"); }
Already tamed: function () { return tameDocument.body___.clientTop; }
Already tamed: function propertyOnlyHasGetter(_) { throw new TypeError("setting a property that only has a getter"); }
Already tamed: function () { return tameDocument.body___.clientTop; }
Already tamed: function propertyOnlyHasGetter(_) { throw new TypeError("setting a property that only has a getter"); }
Already tamed: function () { return tameDocument.body___.clientTop; }
Already tamed: function propertyOnlyHasGetter(_) { throw new TypeError("setting a property that only has a getter"); }
Already tamed: function propertyOnlyHasGetter(_) { throw new TypeError("setting a property that only has a getter"); }
Already tamed: function () { return tameDocument.body___.clientLeft; }
Already tamed: function propertyOnlyHasGetter(_) { throw new TypeError("setting a property that only has a getter"); }
Already tamed: function () { return tameDocument.body___.clientLeft; }
Already tamed: function propertyOnlyHasGetter(_) { throw new TypeError("setting a property that only has a getter"); }
Already tamed: function () { return tameDocument.body___.clientLeft; }
Already tamed: function funcBound(var_args) { var args = leftArgs.concat(slice.call(arguments, 0)); return thisFunc.apply(safeDis(self), args); }
Already tamed: function propertyOnlyHasGetter(_) { throw new TypeError("setting a property that only has a getter"); }
Already tamed: function () { return this.getGeometryDelegate___().scrollHeight; }
Already tamed: function propertyOnlyHasGetter(_) { throw new TypeError("setting a property that only has a getter"); }
Already tamed: function () { return this.getGeometryDelegate___().scrollWidth; }
Already tamed: function (y) { if (!this.editable___) { throw new Error(NOT_EDITABLE); } this.getGeometryDelegate___().scrollTop = + y; return y; }
Already tamed: function () { return this.getGeometryDelegate___().scrollTop; }
Already tamed: function (x) { if (!this.editable___) { throw new Error(NOT_EDITABLE); } this.getGeometryDelegate___().scrollLeft = + x; return x; }
Already tamed: function () { return this.getGeometryDelegate___().scrollLeft; }
Already tamed: function propertyOnlyHasGetter(_) { throw new TypeError("setting a property that only has a getter"); }
Already tamed: function () { return this.getGeometryDelegate___().offsetHeight; }
Already tamed: function propertyOnlyHasGetter(_) { throw new TypeError("setting a property that only has a getter"); }
Already tamed: function () { return this.getGeometryDelegate___().offsetWidth; }
Already tamed: function propertyOnlyHasGetter(_) { throw new TypeError("setting a property that only has a getter"); }
Already tamed: function () { return this.getGeometryDelegate___().offsetTop; }
Already tamed: function propertyOnlyHasGetter(_) { throw new TypeError("setting a property that only has a getter"); }
Already tamed: function () { return this.getGeometryDelegate___().offsetLeft; }
Already tamed: function propertyOnlyHasGetter(_) { throw new TypeError("setting a property that only has a getter"); }
Already tamed: function () { return this.getGeometryDelegate___().clientHeight; }
Already tamed: function () { return this.getGeometryDelegate___().clientWidth; }
Already tamed: function () { return this.tagName___; }
Already tamed: function () { return this.innerHTMLGetter___(); }
Already tamed: function () { return 1; }
Already tamed: function () { return null; }
Already tamed: function () { return this.tagName___; }
Already tamed: function () { var children = this.getChildNodes___(); return children.length ? children[0] : null; }
Already tamed: function () { var children = this.getChildNodes___(); return children.length ? children[children.length - 1] : null; }
Already tamed: function () { var parentNode = this.getParentNode___(); if (!parentNode) { return null; } var siblings = parentNode.getChildNodes___(); for (var i = siblings.length - 1; --i >= 0;) { if (siblings[i] === this) { return siblings[i + 1]; } } return null; }
Already tamed: function () { var parentNode = this.getParentNode___(); if (!parentNode) { return null; } var siblings = parentNode.getChildNodes___(); for (var i = siblings.length; --i >= 1;) { if (siblings[i] === this) { return siblings[i - 1]; } } return null; }
Already tamed: function () { return this.parentNodeGetter___(); }
Already tamed: function () { return this.tameDoc___; }
Already tamed: function () { return this.childNodesGetter___(); }
Already tamed: function () { return tameNodeList([], false, undefined); }
Already tamed: function propertyOnlyHasGetter(_) { throw new TypeError("setting a property that only has a getter"); }
Already tamed: function () { return this.getGeometryDelegate___().scrollHeight; }
Already tamed: function propertyOnlyHasGetter(_) { throw new TypeError("setting a property that only has a getter"); }
Already tamed: function () { return this.getGeometryDelegate___().scrollWidth; }
Already tamed: function (y) { if (!this.editable___) { throw new Error(NOT_EDITABLE); } this.getGeometryDelegate___().scrollTop = + y; return y; }
Already tamed: function () { return this.getGeometryDelegate___().scrollTop; }
Already tamed: function (x) { if (!this.editable___) { throw new Error(NOT_EDITABLE); } this.getGeometryDelegate___().scrollLeft = + x; return x; }
Already tamed: function () { return this.getGeometryDelegate___().scrollLeft; }
Already tamed: function propertyOnlyHasGetter(_) { throw new TypeError("setting a property that only has a getter"); }
Already tamed: function () { return this.getGeometryDelegate___().offsetHeight; }
Already tamed: function propertyOnlyHasGetter(_) { throw new TypeError("setting a property that only has a getter"); }
Already tamed: function () { return this.getGeometryDelegate___().offsetWidth; }
Already tamed: function propertyOnlyHasGetter(_) { throw new TypeError("setting a property that only has a getter"); }
Already tamed: function () { return this.getGeometryDelegate___().offsetTop; }
Already tamed: function propertyOnlyHasGetter(_) { throw new TypeError("setting a property that only has a getter"); }
Already tamed: function () { return this.getGeometryDelegate___().offsetLeft; }
Already tamed: function propertyOnlyHasGetter(_) { throw new TypeError("setting a property that only has a getter"); }
Already tamed: function () { return this.getGeometryDelegate___().clientHeight; }
Already tamed: function () { return this.getGeometryDelegate___().clientWidth; }
Already tamed: function () { return this.tagName___; }
Already tamed: function () { return this.innerHTMLGetter___(); }
Already tamed: function () { return 1; }
Already tamed: function () { return null; }
Already tamed: function () { return this.tagName___; }
Already tamed: function () { var children = this.getChildNodes___(); return children.length ? children[0] : null; }
Already tamed: function () { var children = this.getChildNodes___(); return children.length ? children[children.length - 1] : null; }
Already tamed: function () { var parentNode = this.getParentNode___(); if (!parentNode) { return null; } var siblings = parentNode.getChildNodes___(); for (var i = siblings.length - 1; --i >= 0;) { if (siblings[i] === this) { return siblings[i + 1]; } } return null; }
Already tamed: function () { var parentNode = this.getParentNode___(); if (!parentNode) { return null; } var siblings = parentNode.getChildNodes___(); for (var i = siblings.length; --i >= 1;) { if (siblings[i] === this) { return siblings[i - 1]; } } return null; }
Already tamed: function () { return this.parentNodeGetter___(); }
Already tamed: function () { return this.tameDoc___; }
Already tamed: function () { return this.childNodesGetter___(); }
Already tamed: function () { return tameNodeList([], false, undefined); }
Already tamed: function propertyOnlyHasGetter(_) { throw new TypeError("setting a property that only has a getter"); }
Already tamed: function () { return this.getGeometryDelegate___().scrollHeight; }
Already tamed: function propertyOnlyHasGetter(_) { throw new TypeError("setting a property that only has a getter"); }
Already tamed: function () { return this.getGeometryDelegate___().scrollWidth; }
Already tamed: function (y) { if (!this.editable___) { throw new Error(NOT_EDITABLE); } this.getGeometryDelegate___().scrollTop = + y; return y; }
Already tamed: function () { return this.getGeometryDelegate___().scrollTop; }
Already tamed: function (x) { if (!this.editable___) { throw new Error(NOT_EDITABLE); } this.getGeometryDelegate___().scrollLeft = + x; return x; }
Already tamed: function () { return this.getGeometryDelegate___().scrollLeft; }
Already tamed: function propertyOnlyHasGetter(_) { throw new TypeError("setting a property that only has a getter"); }
Already tamed: function () { return this.getGeometryDelegate___().offsetHeight; }
Already tamed: function propertyOnlyHasGetter(_) { throw new TypeError("setting a property that only has a getter"); }
Already tamed: function () { return this.getGeometryDelegate___().offsetWidth; }
Already tamed: function propertyOnlyHasGetter(_) { throw new TypeError("setting a property that only has a getter"); }
Already tamed: function () { return this.getGeometryDelegate___().offsetTop; }
Already tamed: function propertyOnlyHasGetter(_) { throw new TypeError("setting a property that only has a getter"); }
Already tamed: function () { return this.getGeometryDelegate___().offsetLeft; }
Already tamed: function propertyOnlyHasGetter(_) { throw new TypeError("setting a property that only has a getter"); }
Already tamed: function () { return this.getGeometryDelegate___().clientHeight; }
Already tamed: function () { return this.getGeometryDelegate___().clientWidth; }
Already tamed: function () { return this.tagName___; }
Already tamed: function () { return this.innerHTMLGetter___(); }
Already tamed: function () { return 1; }
Already tamed: function () { return null; }
Already tamed: function () { return this.tagName___; }
Already tamed: function () { var children = this.getChildNodes___(); return children.length ? children[0] : null; }
Already tamed: function () { var children = this.getChildNodes___(); return children.length ? children[children.length - 1] : null; }
Already tamed: function () { var parentNode = this.getParentNode___(); if (!parentNode) { return null; } var siblings = parentNode.getChildNodes___(); for (var i = siblings.length - 1; --i >= 0;) { if (siblings[i] === this) { return siblings[i + 1]; } } return null; }
Already tamed: function () { var parentNode = this.getParentNode___(); if (!parentNode) { return null; } var siblings = parentNode.getChildNodes___(); for (var i = siblings.length; --i >= 1;) { if (siblings[i] === this) { return siblings[i - 1]; } } return null; }
Already tamed: function () { return this.parentNodeGetter___(); }
Already tamed: function () { return this.tameDoc___; }
Already tamed: function () { return this.childNodesGetter___(); }
Already tamed: function () { return tameNodeList([], false, undefined); }
Already tamed: function funcBound(var_args) { var args = leftArgs.concat(slice.call(arguments, 0)); return thisFunc.apply(safeDis(self), args); }
Already tamed: function funcBound(var_args) { var args = leftArgs.concat(slice.call(arguments, 0)); return thisFunc.apply(safeDis(self), args); }
Already tamed: function funcBound(var_args) { var args = leftArgs.concat(slice.call(arguments, 0)); return thisFunc.apply(safeDis(self), args); }
Already tamed: function funcBound(var_args) { var args = leftArgs.concat(slice.call(arguments, 0)); return thisFunc.apply(safeDis(self), args); }
Already tamed: function propertyOnlyHasGetter(_) { throw new TypeError("setting a property that only has a getter"); }
Already tamed: function () { return this.getGeometryDelegate___().scrollHeight; }
Already tamed: function propertyOnlyHasGetter(_) { throw new TypeError("setting a property that only has a getter"); }
Already tamed: function () { return this.getGeometryDelegate___().scrollWidth; }
Already tamed: function (y) { if (!this.editable___) { throw new Error(NOT_EDITABLE); } this.getGeometryDelegate___().scrollTop = + y; return y; }
Already tamed: function () { return this.getGeometryDelegate___().scrollTop; }
Already tamed: function (x) { if (!this.editable___) { throw new Error(NOT_EDITABLE); } this.getGeometryDelegate___().scrollLeft = + x; return x; }
Already tamed: function () { return this.getGeometryDelegate___().scrollLeft; }
Already tamed: function propertyOnlyHasGetter(_) { throw new TypeError("setting a property that only has a getter"); }
Already tamed: function () { return this.getGeometryDelegate___().offsetHeight; }
Already tamed: function propertyOnlyHasGetter(_) { throw new TypeError("setting a property that only has a getter"); }
Already tamed: function () { return this.getGeometryDelegate___().offsetWidth; }
Already tamed: function propertyOnlyHasGetter(_) { throw new TypeError("setting a property that only has a getter"); }
Already tamed: function () { return this.getGeometryDelegate___().offsetTop; }
Already tamed: function propertyOnlyHasGetter(_) { throw new TypeError("setting a property that only has a getter"); }
Already tamed: function () { return this.getGeometryDelegate___().offsetLeft; }
Already tamed: function propertyOnlyHasGetter(_) { throw new TypeError("setting a property that only has a getter"); }
Already tamed: function () { return this.getGeometryDelegate___().clientHeight; }
Already tamed: function () { return this.getGeometryDelegate___().clientWidth; }
Already tamed: function () { return this.tagName___; }
Already tamed: function () { var children = this.getChildNodes___(); return children.length ? children[0] : null; }
Already tamed: function () { var children = this.getChildNodes___(); return children.length ? children[children.length - 1] : null; }
Already tamed: function () { var parentNode = this.getParentNode___(); if (!parentNode) { return null; } var siblings = parentNode.getChildNodes___(); for (var i = siblings.length - 1; --i >= 0;) { if (siblings[i] === this) { return siblings[i + 1]; } } return null; }
Already tamed: function () { var parentNode = this.getParentNode___(); if (!parentNode) { return null; } var siblings = parentNode.getChildNodes___(); for (var i = siblings.length; --i >= 1;) { if (siblings[i] === this) { return siblings[i - 1]; } } return null; }
Already tamed: function propertyOnlyHasGetter(_) { throw new TypeError("setting a property that only has a getter"); }
Already tamed: function propertyOnlyHasGetter(_) { throw new TypeError("setting a property that only has a getter"); }
Already tamed: function propertyOnlyHasGetter(_) { throw new TypeError("setting a property that only has a getter"); }
Already tamed: function propertyOnlyHasGetter(_) { throw new TypeError("setting a property that only has a getter"); }
Already tamed: function propertyOnlyHasGetter(_) { throw new TypeError("setting a property that only has a getter"); }
Already tamed: function propertyOnlyHasGetter(_) { throw new TypeError("setting a property that only has a getter"); }
Already tamed: function propertyOnlyHasGetter(_) { throw new TypeError("setting a property that only has a getter"); }
Already tamed: function () { return this.node___.nodeName; }
Already tamed: function (newText) { if (!this.editable___) { throw new Error(NOT_EDITABLE); } var newTextStr = newText != null ? String(newText) : ""; var el = this.node___; for (var c; c = el.firstChild;) { el.removeChild(c); } if (newTextStr) { el.appendChild(el.ownerDocument.createTextNode(newTextStr)); } return newText; }
Already tamed: function () { var text = []; innerTextOf(this.node___, text); return text.join(""); }

Mark S. Miller

unread,
Sep 25, 2010, 11:34:34 PM9/25/10
to eri...@gmail.com, meta...@gmail.com, st...@google.com, google-ca...@googlegroups.com, re...@codereview.appspotmail.com
On Sat, Sep 25, 2010 at 8:28 PM, Mark S. Miller <eri...@google.com> wrote:
On Thu, Sep 23, 2010 at 9:59 PM, <eri...@google.com> wrote:
http://codereview.appspot.com/2225043/diff/10001/src/com/google/caja/es53.js#newcode751
src/com/google/caja/es53.js:751: // Is there any reason even to log
these? They are many, and
On 2010/09/23 20:56:02, metaweta wrote:
There shouldn't be any; where are you seeing them?  I was getting
errors due to
accidentally taming something in two ways, so I put this in.

I don't remember. I'll instrument and re-run until I reproduce this. Or
I'll revert.

The reason you weren't seeing these dups was that your previous line
    fn.f___ !== fn.apply
was buggy. After I corrected to
    fn.f___ === fn.apply
I saw the error. When I change the error report to simply logging dups, I see trace shown below.

The other possibility is that I misunderstand the purpose of your equality test and that it was not originally buggy. In which case my "fix" created the problem. Please advise.

 

--
    Cheers,
    --MarkM

eri...@gmail.com

unread,
Sep 26, 2010, 2:07:11 AM9/26/10
to meta...@gmail.com, st...@google.com, eri...@google.com, google-ca...@googlegroups.com, re...@codereview.appspotmail.com
Reviewers: metaweta, stay_google.com, Mark S. Miller,

Message:
A significant number of other changes as well.

http://codereview.appspot.com/2225043/diff/10001/src/com/google/caja/es53.js#newcode751


src/com/google/caja/es53.js:751: // Is there any reason even to log
these? They are many, and

On 2010/09/24 04:59:10, Mark S. Miller wrote:
> On 2010/09/23 20:56:02, metaweta wrote:
> > There shouldn't be any; where are you seeing them? I was getting
errors due
> to
> > accidentally taming something in two ways, so I put this in.

> I don't remember. I'll instrument and re-run until I reproduce this.
Or I'll
> revert.

See
https://groups.google.com/group/google-caja-discuss/msg/5b2692533f00637c

Description:
Emulated ES-Harmony Proxies.
Offers our internal table as a WeakMap emulation.

Please review this at http://codereview.appspot.com/2225043/

Affected files:
M src/com/google/caja/es53.js
M tests/com/google/caja/parser/quasiliteral/ES53RewriterTest.java


meta...@gmail.com

unread,
Sep 26, 2010, 12:03:24 PM9/26/10
to eri...@gmail.com, st...@google.com, eri...@google.com, google-ca...@googlegroups.com, re...@codereview.appspotmail.com
On 2010/09/26 03:28:28, Mark S. Miller wrote:
> The reason you weren't seeing these dups was that your previous line
> fn.f___ !== fn.apply
> was buggy. After I corrected to
> fn.f___ === fn.apply
> I saw the error. When I change the error report to simply logging
dups, I
> see trace shown below.

No, that's how I intended it; double-taming a simple function is
harmless, but taming it one way and then accidentally taming it as a
simple function later can break stuff.

http://codereview.appspot.com/2225043/

eri...@gmail.com

unread,
Sep 26, 2010, 12:18:13 PM9/26/10
to meta...@gmail.com, st...@google.com, eri...@google.com, google-ca...@googlegroups.com, re...@codereview.appspotmail.com

Restored. Made the error a tad clearer.

http://codereview.appspot.com/2225043/

Reply all
Reply to author
Forward
0 new messages