Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code | Sign in
(265)

Issue 8676043: Refactoring Domado: bundle nodeClasses/inertCtor into an object. (Closed)

Can't Edit
Can't Publish+Mail
Start Review
Created:
12 years, 11 months ago by kpreid2
Modified:
12 years, 11 months ago
Reviewers:
felix8a
CC:
google-caja-discuss_googlegroups.com
Base URL:
http://google-caja.googlecode.com/svn/trunk/
Visibility:
Public.

Description

Put nodeClasses and nodeTamers tables into an object to manage their state transitions and consistency. This is intended to make load order dependencies more visible and fail-stop, make further refactoring easier, and prepare for future reuse (e.g. taming setTimeout and XMLHttpRequest without an associated DOM). @r5354

Patch Set 1 #

Patch Set 2 : Refactoring Domado: bundle nodeClasses/inertCtor into an object. #

Total comments: 8

Patch Set 3 : Refactoring Domado: bundle nodeClasses/inertCtor into an object. #

Patch Set 4 : Refactoring Domado: bundle nodeClasses/inertCtor into an object. #

Unified diffs Side-by-side diffs Delta from patch set Stats (+137 lines, -89 lines) Patch
M src/com/google/caja/plugin/domado.js View 1 2 13 chunks +137 lines, -89 lines 0 comments Download

Messages

Total messages: 6
kpreid2
12 years, 11 months ago (2013-04-11 19:15:05 UTC) #1
kpreid2
Put nodeClasses and nodeTamers tables into an object to manage their state transitions and consistency. ...
12 years, 11 months ago (2013-04-11 19:21:39 UTC) #2
felix8a
lgtm https://codereview.appspot.com/8676043/diff/2001/src/com/google/caja/plugin/domado.js File src/com/google/caja/plugin/domado.js (right): https://codereview.appspot.com/8676043/diff/2001/src/com/google/caja/plugin/domado.js#newcode1157 src/com/google/caja/plugin/domado.js:1157: prototypeNames.set(safeCtor.prototype, name); it feels odd that this set ...
12 years, 11 months ago (2013-04-14 20:57:37 UTC) #3
kpreid2
Put nodeClasses and nodeTamers tables into an object to manage their state transitions and consistency. ...
12 years, 11 months ago (2013-04-15 18:36:04 UTC) #4
kpreid2
Put nodeClasses and nodeTamers tables into an object to manage their state transitions and consistency. ...
12 years, 11 months ago (2013-04-15 18:36:21 UTC) #5
kpreid2
12 years, 11 months ago (2013-04-15 18:36:26 UTC) #6
Going to submit since you said LGTM; changes as noted below.

https://codereview.appspot.com/8676043/diff/2001/src/com/google/caja/plugin/d...
File src/com/google/caja/plugin/domado.js (right):

https://codereview.appspot.com/8676043/diff/2001/src/com/google/caja/plugin/d...
src/com/google/caja/plugin/domado.js:1157:
prototypeNames.set(safeCtor.prototype, name);
On 2013/04/14 20:57:37, felix8a wrote:
> it feels odd that this set is conditional, but I can't think of a simpler
> alternative, so ok.

There are two cases where a class is given two names, and we want to use the
first one (HTMLElement vs. Element, HTMLDocument vs. Document). Those are
technically incorrect; I just haven't bothered adding a mostly-useless
additional prototype. If I ever do, this can become a hard failure instead.
Added comments.

https://codereview.appspot.com/8676043/diff/2001/src/com/google/caja/plugin/d...
src/com/google/caja/plugin/domado.js:1160: this.registerSafeCtor =
registerSafeCtor;
On 2013/04/14 20:57:37, felix8a wrote:
> any reason this is a separate statement unlike the other functions?

Obsolete reason: a previous version used registerSafeCtor inside of inertCtor.
Changed.

https://codereview.appspot.com/8676043/diff/2001/src/com/google/caja/plugin/d...
src/com/google/caja/plugin/domado.js:1173: this.exportTo = function
exportTo(imports) {
On 2013/04/14 20:57:37, felix8a wrote:
> maybe add a paranoia check, abort here if safeCtors isn't frozen?

Done.

https://codereview.appspot.com/8676043/diff/2001/src/com/google/caja/plugin/d...
src/com/google/caja/plugin/domado.js:2687: if ((specificTamer =
On 2013/04/14 20:57:37, felix8a wrote:
> how about move this assignment out of the if?

I like having the details of the lookup inside the conditional, but it's
particularly ugly here, yes.

Done.
Sign in to reply to this message.

Powered by Google App Engine
RSS Feeds Recent Issues | This issue
This is Rietveld f62528b