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

Issue 54450044: [APICHANGE] Separate test/repair algorithm from repairES5.js and use it in WeakMap.js. (Closed)

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

Description

Extract the notion of tests and repairs from repairES5.js and make it available as a reusable algorithm, in new file repair-framework.js. All state is now bundled in the new Repairer class, of which there is a singleton instance ses._repairer; this structure allows the test/repair algorithm to be unit-tested. * "Kludge records" are now known as "problem records" consistently. * Define "absence of WeakMap" as a problem and use ses._repairer in WeakMap.js; WeakMap.js no longer uses its top level control flow to control what patching is done. SES API changes (most likely of interest to custom loggers): * The meaning of ses.ok() is changed. It will now return whether tests and repairs _have been done_ and the system is safe, as opposed to returning false only if we've decided to fail. Introduce ses.okToLoad() with the old meaning, which is used to decide whether to continue loading parts of SES. I hope to make the startSES "dirty" flag subsumed by this mechanism, but have left that for future work. * ses.maxSeverity no longer exists, since its role has been replaced by internal state of the repairer object. The same value is available as ses.getMaxSeverity(); note that it retains the original meaning corresponding to ses.okToLoad() rather than ses.ok(). * logger.reportRepairs may be called more than once (currently, when WeakMap performs its "add WeakMap" test/repair after repairES5 has completed). We may want to improve this design later. For <https://code.google.com/p/google-caja/issues/detail?id=1878>. @r5659

Patch Set 1 #

Total comments: 36

Patch Set 2 : [APICHANGE] Separate test/repair algorithm from repairES5.js and use it in WeakMap.js. #

Total comments: 2

Patch Set 3 : [APICHANGE] Separate test/repair algorithm from repairES5.js and use it in WeakMap.js. #

Patch Set 4 : [APICHANGE] Separate test/repair algorithm from repairES5.js and use it in WeakMap.js. #

Unified diffs Side-by-side diffs Delta from patch set Stats (+1725 lines, -908 lines) Patch
M build.xml View 1 2 chunks +2 lines, -0 lines 0 comments Download
M src/com/google/caja/ses/WeakMap.js View 1 2 3 chunks +550 lines, -471 lines 0 comments Download
M src/com/google/caja/ses/compileExprLater.js View 1 2 chunks +2 lines, -2 lines 0 comments Download
M src/com/google/caja/ses/debug.js View 1 1 chunk +1 line, -1 line 0 comments Download
M src/com/google/caja/ses/explicit.html View 1 1 chunk +1 line, -0 lines 0 comments Download
M src/com/google/caja/ses/hookupSES.js View 1 1 chunk +1 line, -1 line 0 comments Download
M src/com/google/caja/ses/hookupSESPlus.js View 1 1 chunk +1 line, -1 line 0 comments Download
M src/com/google/caja/ses/logger.js View 1 1 chunk +2 lines, -2 lines 0 comments Download
A src/com/google/caja/ses/repair-framework.js View 1 2 3 1 chunk +745 lines, -0 lines 0 comments Download
M src/com/google/caja/ses/repairES5.js View 1 2 3 25 chunks +76 lines, -427 lines 0 comments Download
M src/com/google/caja/ses/startSES.js View 1 1 chunk +4 lines, -1 line 0 comments Download
M src/com/google/caja/ses/useHTMLLogger.js View 1 1 chunk +2 lines, -2 lines 0 comments Download
M tests/com/google/caja/ses/ses-tests.json View 1 1 chunk +4 lines, -0 lines 0 comments Download
A tests/com/google/caja/ses/test-repair-framework.js View 1 2 1 chunk +329 lines, -0 lines 0 comments Download
M tests/com/google/caja/ses/test-ses-parts.js View 1 1 chunk +5 lines, -0 lines 0 comments Download

Messages

Total messages: 11
kpreid2
12 years, 1 month ago (2014-01-22 17:46:46 UTC) #1
MarkM
I still have yet to review repair-framework and test-repair-framework. But these are my comments so ...
12 years, 1 month ago (2014-01-29 19:32:49 UTC) #2
kpreid2
Extract the notion of tests and repairs from repairES5.js and make it available as a ...
12 years, 1 month ago (2014-01-29 20:29:40 UTC) #3
kpreid2
New snapshot, including merge with WeakMap algorithm change. https://codereview.appspot.com/54450044/diff/1/src/com/google/caja/ses/WeakMap.js File src/com/google/caja/ses/WeakMap.js (left): https://codereview.appspot.com/54450044/diff/1/src/com/google/caja/ses/WeakMap.js#oldcode170 src/com/google/caja/ses/WeakMap.js:170: var ...
12 years, 1 month ago (2014-01-29 20:30:21 UTC) #4
MarkM
I'm still reviewing repair-framework and test-repair-framework. The rest LGTM https://codereview.appspot.com/54450044/diff/1/src/com/google/caja/ses/WeakMap.js File src/com/google/caja/ses/WeakMap.js (right): https://codereview.appspot.com/54450044/diff/1/src/com/google/caja/ses/WeakMap.js#newcode194 src/com/google/caja/ses/WeakMap.js:194: ...
12 years, 1 month ago (2014-01-29 22:03:23 UTC) #5
kpreid2
Extract the notion of tests and repairs from repairES5.js and make it available as a ...
12 years, 1 month ago (2014-01-30 18:37:33 UTC) #6
kpreid2
https://codereview.appspot.com/54450044/diff/1/src/com/google/caja/ses/WeakMap.js File src/com/google/caja/ses/WeakMap.js (right): https://codereview.appspot.com/54450044/diff/1/src/com/google/caja/ses/WeakMap.js#newcode194 src/com/google/caja/ses/WeakMap.js:194: // } catch (e) {} On 2014/01/29 22:03:24, MarkM ...
12 years, 1 month ago (2014-01-30 18:38:26 UTC) #7
MarkM
LGTM https://codereview.appspot.com/54450044/diff/1/src/com/google/caja/ses/repair-framework.js File src/com/google/caja/ses/repair-framework.js (right): https://codereview.appspot.com/54450044/diff/1/src/com/google/caja/ses/repair-framework.js#newcode302 src/com/google/caja/ses/repair-framework.js:302: var postTestKludge = undefined; Stale name? https://codereview.appspot.com/54450044/diff/1/src/com/google/caja/ses/repair-framework.js#newcode310 src/com/google/caja/ses/repair-framework.js:310: ...
12 years, 1 month ago (2014-01-30 20:17:17 UTC) #8
kpreid2
Extract the notion of tests and repairs from repairES5.js and make it available as a ...
12 years, 1 month ago (2014-02-03 22:35:20 UTC) #9
kpreid2
New snapshot. https://codereview.appspot.com/54450044/diff/1/src/com/google/caja/ses/repair-framework.js File src/com/google/caja/ses/repair-framework.js (right): https://codereview.appspot.com/54450044/diff/1/src/com/google/caja/ses/repair-framework.js#newcode302 src/com/google/caja/ses/repair-framework.js:302: var postTestKludge = undefined; On 2014/01/30 20:17:18, ...
12 years, 1 month ago (2014-02-03 22:36:04 UTC) #10
MarkM
12 years, 1 month ago (2014-02-03 22:41:42 UTC) #11
Still LGTM
Sign in to reply to this message.

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