Reviewers: felix8a, 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). Please review this at http://codereview.appspot.com/5648043/ Affected files: M build.xml M src/com/google/caja/ses/StringMap.js M src/com/google/caja/ses/WeakMap.js M src/com/google/caja/ses/amdTest.js M src/com/google/caja/ses/amdTest1.js M src/com/google/caja/ses/amdTest3.js M src/com/google/caja/ses/amdTestDir/amdTest2.js M src/com/google/caja/ses/atLeastFreeVarNames.js A src/com/google/caja/ses/compileExprLater.js A src/com/google/caja/ses/debug.js M src/com/google/caja/ses/detect.js M src/com/google/caja/ses/ejectorsGuardsTrademarks.js M src/com/google/caja/ses/explicit.html M src/com/google/caja/ses/hookupSES.js M src/com/google/caja/ses/hookupSESPlus.js M src/com/google/caja/ses/logger.js M src/com/google/caja/ses/makeFarResourceMaker.js M src/com/google/caja/ses/makeQ.js M src/com/google/caja/ses/makeSimpleAMDLoader.js M src/com/google/caja/ses/repairES5.js M src/com/google/caja/ses/startSES.js M src/com/google/caja/ses/useHTMLLogger.js M src/com/google/caja/ses/whitelist.js
