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

Issue 5648043: AMDLoader in SES and other SES refactoring (Closed)

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

Description

Taking over from erights CL * refactored startSES.js to separate wrapping from compilation, enabling other ways to recombine them, like script injection (see below). * compileExprLater.js -- Implemented a compileExprLater abstraction, which is like cajaVM.compileExpr, except that it returns a promise which eventually becomes the compiled expr function. This abstraction enables future interoperation with ES5/3, where server-side translation requires an asynchrony barrier. The compileExprLater, if it finds itself in a browser environment, uses script injection rather than "eval", avoiding yet more stratification bugs in Chrome's debugger. * refactored explicit.html to use compileExprLater, to load makeSimpleAMDLoader outside the SES TCB. It is therefore now also multiply instantiable and debuggable. * refactored makeSimpleAMDLoader.js to make use of compileExprLater to load AMD modules, making them also debuggable under the Chrome debugger. * repairES5.js and startSES.js -- The big additional feature in this CL is to "support override by assignment in SES", enabling SES to accept far more legacy best practice JS code. * repairES5.js -- More repairs * debug.js -- A start on being able to report stack traces for errors while still denying untrusted code access to these errors, all without translation. All platforms should be safe, but the stack capture works only on Chrome. * refactored startSES.js so all freezing of primordials is gathered together, as a step toward supporting confined SES (sacrificing defensiveness in exchange for greater legacy compatibility). @4779

Patch Set 1 #

Patch Set 2 : AMDLoader in SES and other SES refactoring #

Total comments: 15

Patch Set 3 : AMDLoader in SES and other SES refactoring #

Patch Set 4 : AMDLoader in SES and other SES refactoring #

Total comments: 2

Patch Set 5 : AMDLoader in SES and other SES refactoring #

Unified diffs Side-by-side diffs Delta from patch set Stats (+1416 lines, -533 lines) Patch
M build.xml View 3 chunks +14 lines, -0 lines 0 comments Download
M src/com/google/caja/ses/StringMap.js View 1 chunk +38 lines, -31 lines 0 comments Download
M src/com/google/caja/ses/WeakMap.js View 2 chunks +10 lines, -1 line 0 comments Download
M src/com/google/caja/ses/amdTest.js View 1 chunk +5 lines, -1 line 0 comments Download
M src/com/google/caja/ses/amdTest1.js View 1 chunk +2 lines, -0 lines 0 comments Download
M src/com/google/caja/ses/amdTest3.js View 1 chunk +13 lines, -3 lines 0 comments Download
M src/com/google/caja/ses/amdTestDir/amdTest2.js View 1 chunk +2 lines, -0 lines 0 comments Download
M src/com/google/caja/ses/atLeastFreeVarNames.js View 1 2 2 chunks +5 lines, -0 lines 0 comments Download
A src/com/google/caja/ses/compileExprLater.js View 1 2 1 chunk +139 lines, -0 lines 0 comments Download
A src/com/google/caja/ses/debug.js View 1 2 3 1 chunk +217 lines, -0 lines 0 comments Download
M src/com/google/caja/ses/detect.js View 1 chunk +8 lines, -0 lines 0 comments Download
M src/com/google/caja/ses/ejectorsGuardsTrademarks.js View 12 chunks +51 lines, -67 lines 0 comments Download
M src/com/google/caja/ses/explicit.html View 1 2 5 chunks +80 lines, -56 lines 0 comments Download
M src/com/google/caja/ses/hookupSES.js View 1 chunk +1 line, -1 line 0 comments Download
M src/com/google/caja/ses/hookupSESPlus.js View 1 chunk +1 line, -1 line 0 comments Download
M src/com/google/caja/ses/logger.js View 5 chunks +46 lines, -10 lines 0 comments Download
M src/com/google/caja/ses/makeFarResourceMaker.js View 4 chunks +14 lines, -16 lines 0 comments Download
M src/com/google/caja/ses/makeQ.js View 12 chunks +41 lines, -42 lines 0 comments Download
M src/com/google/caja/ses/makeSimpleAMDLoader.js View 5 chunks +24 lines, -20 lines 0 comments Download
M src/com/google/caja/ses/repairES5.js View 1 2 3 4 22 chunks +458 lines, -125 lines 0 comments Download
M src/com/google/caja/ses/startSES.js View 24 chunks +203 lines, -151 lines 0 comments Download
M src/com/google/caja/ses/useHTMLLogger.js View 3 chunks +40 lines, -8 lines 0 comments Download
M src/com/google/caja/ses/whitelist.js View 2 chunks +4 lines, -0 lines 0 comments Download

Messages

Total messages: 6
Jasvir
14 years, 4 months ago (2012-02-09 07:17:27 UTC) #1
Jasvir
http://codereview.appspot.com/5648043/diff/3001/src/com/google/caja/ses/compileExprLater.js File src/com/google/caja/ses/compileExprLater.js (right): http://codereview.appspot.com/5648043/diff/3001/src/com/google/caja/ses/compileExprLater.js#newcode105 src/com/google/caja/ses/compileExprLater.js:105: scriptSrc = '/* from ' + opt_sourceUrl + ' ...
14 years, 4 months ago (2012-02-09 20:50:49 UTC) #2
felix8a
a few nits but otherwise lgtm http://codereview.appspot.com/5648043/diff/3001/src/com/google/caja/ses/debug.js File src/com/google/caja/ses/debug.js (right): http://codereview.appspot.com/5648043/diff/3001/src/com/google/caja/ses/debug.js#newcode44 src/com/google/caja/ses/debug.js:44: * make it ...
14 years, 4 months ago (2012-02-11 08:36:58 UTC) #3
MarkM
http://codereview.appspot.com/5648043/diff/3001/src/com/google/caja/ses/startSES.js File src/com/google/caja/ses/startSES.js (right): http://codereview.appspot.com/5648043/diff/3001/src/com/google/caja/ses/startSES.js#newcode258 src/com/google/caja/ses/startSES.js:258: func.prototype = null; On 2012/02/11 08:36:58, felix8a wrote: > ...
14 years, 4 months ago (2012-02-11 17:09:40 UTC) #4
Jasvir
http://codereview.appspot.com/5648043/diff/3001/src/com/google/caja/ses/debug.js File src/com/google/caja/ses/debug.js (right): http://codereview.appspot.com/5648043/diff/3001/src/com/google/caja/ses/debug.js#newcode44 src/com/google/caja/ses/debug.js:44: * make it otheriwse unreachable. Replace it with a ...
14 years, 4 months ago (2012-02-11 23:48:11 UTC) #5
felix8a
14 years, 4 months ago (2012-02-12 00:48:41 UTC) #6
http://codereview.appspot.com/5648043/diff/7003/src/com/google/caja/ses/repai...
File src/com/google/caja/ses/repairES5.js (right):

http://codereview.appspot.com/5648043/diff/7003/src/com/google/caja/ses/repai...
src/com/google/caja/ses/repairES5.js:481: throw "makeDelayedTamperProof() must
only be called once.";
typo "makeDelay" here but "makeDelayed" elsewhere.

http://codereview.appspot.com/5648043/diff/7003/src/com/google/caja/ses/repai...
src/com/google/caja/ses/repairES5.js:486: makeDelayTamperProofCalled = true;
also here
Sign in to reply to this message.

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