Mark S. Miller (2013-09-05T13:40:54.000Z)
domenic at domenicdenicola.com (2013-09-08T01:05:05.998Z)
That's how Caja currently deploys. If [feature detection](https://code.google.com/p/google-caja/source/browse/trunk/src/com/google/caja/ses/repairES5.js) says the browser adequately implements ES5, we deploy the (approximately no translation) [SES-on-ES5 implementation](https://code.google.com/p/google-caja/source/browse/trunk/src/com/google/caja/ses/). Otherwise we fall back to Caja's [ES5-to-ES3 translator (ES5/3) and runtime](https://code.google.com/p/google-caja/source/browse/trunk/src/com/google/caja/es53.js). You can see the effect by visiting http://caja.appspot.com/ and watching the menu whose state starts in "Autodetect Mode" and then switches to either "ES5 Mode" or "ES5/3 Mode" depending on this autodetection decision. It is a menu so that you can also override this by manually forcing the choice you'd like. As you can see from [repairES5.js](https://code.google.com/p/google-caja/source/browse/trunk/src/com/google/caja/ses/repairES5.js), the autodetection is tricky because browsers only gradually implemented more and more of ES5 and few implement it completely. But the autodetection has to judge when they implement enough to be considered an ES5 browser. I expect the same will be true for the ES5 to ES6 transition. You can also see the outcome of the individual tests used in this autodetection at http://google-caja.googlecode.com/svn/trunk/src/com/google/caja/ses/explicit.html, or by watching the console when visiting http://caja.appspot.com/.