Revision: 3840
Author: [email protected]
Date: Wed Nov 11 12:20:11 2009
Log: updates environment data files
http://code.google.com/p/google-caja/source/detail?r=3840

Modified:
 /trunk/src/com/google/caja/ancillary/opt/EnvironmentDatum.java
 /trunk/src/com/google/caja/ancillary/opt/Firefox-3.0.12.env.json
 /trunk/src/com/google/caja/ancillary/opt/Firefox-3.0.5.env.json
 /trunk/src/com/google/caja/ancillary/opt/Firefox-3.5.3.env.json
 /trunk/src/com/google/caja/ancillary/opt/MSIE-6.0.env.json
 /trunk/src/com/google/caja/ancillary/opt/Safari-531.9.env.json
 /trunk/src/com/google/caja/ancillary/opt/environment-checks.html
 /trunk/src/com/google/caja/ancillary/opt/environment-checks.js

=======================================
--- /trunk/src/com/google/caja/ancillary/opt/EnvironmentDatum.java Mon Oct 26 18:40:33 2009 +++ /trunk/src/com/google/caja/ancillary/opt/EnvironmentDatum.java Wed Nov 11 12:20:11 2009
@@ -25,6 +25,7 @@
  */
 public enum EnvironmentDatum {
   NAV_USER_AGENT("navigator.userAgent"),
+  IS_WINDOW_GLOBAL("!!this.window && this === window"),
   ES5_STRICT_AVAILABLE("!(function () { return this; }.call(null))"),
   NEG_INDICES_SAFE("void 0 === ((function () {})[-2])"),
   FN_CTORS_PURE(
=======================================
--- /trunk/src/com/google/caja/ancillary/opt/Firefox-3.0.12.env.json Mon Oct 26 18:40:33 2009 +++ /trunk/src/com/google/caja/ancillary/opt/Firefox-3.0.12.env.json Wed Nov 11 12:20:11 2009
@@ -1,1 +1,53 @@
-{"navigator.userAgent":"Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10.5; en-US; rv:1.9.0.12) Gecko/2009070609 Firefox/3.0.12","navigator.appName":"Netscape","navigator.appVersion":"5.0 (Macintosh; en-US)","navigator.platform":"MacIntel","!(function(){return this;}.call(null))":false,"typeof JSON":"undefined","typeof addEventListener":"function","typeof attachEvent":"undefined","typeof document.getElementsByClassName":"function","typeof Date.now":"function","(function(){try{return(document.createElement('<input type=\"radio\">').type === 'radio');}catch(e){return(false);}})()":false,"typeof document.createElement('style').styleSheet":"undefined","typeof document.body.style.cssText":"string","typeof XMLHttpRequest":"function","typeof ActiveXObject":"undefined","typeof getComputedStyle":"function","typeof document.body.currentStyle":"undefined","typeof document.documentElement.compareDocumentPosition":"function","typeof document.documentElement.contains":"undefined","typeof document.createEvent":"function","typeof document.createEventObject":"undefined","typeof Date.prototype.toISOString":"undefined","typeof Date.prototype.toJSON":"undefined","typeof Array.slice":"function","typeof Function.prototype.bind":"undefined","void 0 === ((function(){})[-2])":false,"void 0 === ((function(){var b,a=function b(){};return b;})())":true,"(function(){var e=true;try{throw false;}catch(e){}return e;})()":true,"typeof new RegExp('x')":"object","'a'==('a'[0])":true,"(function(){var a;if(0)function a(){}return void 0===a;})()":true,"typeof ({}).__proto__":"object","document.body.setAttribute.length === 2":true,"eval(\"'\u200d'\").length === 1":true,"'a,,a'.split(',').length === 3":true} +{"navigator.userAgent":"Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10.5; en-US; rv:1.9.0.12) Gecko/2009070609 Firefox/3.0.12",
+"navigator.appName":"Netscape",
+"navigator.appVersion":"5.0 (Macintosh; en-US)",
+"navigator.platform":"MacIntel",
+"typeof undefined":"undefined",
+"Infinity === 1/0":true,
+"isNaN(NaN)":true,
+"!!this.window && this === window":true,
+"!(function () { return this; }.call(null))":false,
+"typeof JSON":"undefined",
+"typeof addEventListener":"function",
+"typeof attachEvent":"undefined",
+"!!window.attachEvent":false,
+"typeof document.getElementsByClassName":"function",
+"typeof document.documentElement.getElementsByClassName":"function",
+"!!document.all":false,
+"typeof Date.now":"function",
+"(function(){try{return(document.createElement('<input type=\"radio\">').type === 'radio');}catch(e){return(false);}})()":false,
+"typeof document.createElement('style').styleSheet":"undefined",
+"typeof document.body.style.cssText":"string",
+"typeof XMLHttpRequest":"function",
+"typeof ActiveXObject":"undefined",
+"typeof getComputedStyle":"function",
+"typeof document.body.currentStyle":"undefined",
+"!!document.body.currentStyle":false,
+"typeof document.documentElement.compareDocumentPosition":"function",
+"typeof document.documentElement.contains":"undefined",
+"!!document.documentElement.contains":false,
+"typeof document.createEvent":"function",
+"typeof document.createRange":"function",
+"typeof document.documentElement.doScroll":"undefined",
+"!!typeof document.documentElement.doScroll":true,
+"typeof document.documentElement.getBoundingClientRect":"function",
+"!!document.documentElement.getBoundingClientRect":true,
+"\"sourceIndex\" in document.documentElement":false,
+"typeof document.createEventObject":"undefined",
+"!!document.createEventObject":false,
+"typeof Date.prototype.toISOString":"undefined",
+"typeof Date.prototype.toJSON":"undefined",
+"typeof Array.slice":"function",
+"typeof Function.prototype.bind":"undefined",
+"typeof Object.prototype.toSource":"function",
+"typeof uneval":"function",
+"void 0 === ((function(){})[-2])":false,
+"void 0 === ((function(){var b,a=function b(){};return b;})())":true,
+"(function(){var e=true;try{throw false;}catch(e){}return e;})()":true,
+"typeof new RegExp('x')":"object",
+"'a'==('a'[0])":true,
+"(function(){var a;if(0)function a(){}return void 0===a;})()":true,
+"typeof ({}).__proto__":"object",
+"document.body.setAttribute.length === 2":true,
+"eval(\"'\u200d'\").length === 1":true,
+"'a,,a'.split(',').length === 3":true}
=======================================
--- /trunk/src/com/google/caja/ancillary/opt/Firefox-3.0.5.env.json Mon Oct 26 18:40:33 2009 +++ /trunk/src/com/google/caja/ancillary/opt/Firefox-3.0.5.env.json Wed Nov 11 12:20:11 2009
@@ -1,1 +1,53 @@
-{"navigator.userAgent":"Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.0.5) Gecko/2008120122 Firefox/3.0.5","navigator.appName":"Netscape","navigator.appVersion":"5.0 (Windows; en-US)","navigator.platform":"Win32","!(function(){return this;}.call(null))":false,"typeof JSON":"undefined","typeof addEventListener":"function","typeof attachEvent":"undefined","typeof document.getElementsByClassName":"function","typeof Date.now":"function","(function(){try{return(document.createElement('<input type=\"radio\">').type === 'radio');}catch(e){return(false);}})()":false,"typeof document.createElement('style').styleSheet":"undefined","typeof document.body.style.cssText":"string","typeof XMLHttpRequest":"function","typeof ActiveXObject":"undefined","typeof getComputedStyle":"function","typeof document.body.currentStyle":"undefined","typeof document.documentElement.compareDocumentPosition":"function","typeof document.documentElement.contains":"undefined","typeof document.createEvent":"function","typeof document.createEventObject":"undefined","typeof Date.prototype.toISOString":"undefined","typeof Date.prototype.toJSON":"undefined","typeof Array.slice":"function","typeof Function.prototype.bind":"undefined","void 0 === ((function(){})[-2])":false,"void 0 === ((function(){var b,a=function b(){};return b;})())":true,"(function(){var e=true;try{throw false;}catch(e){}return e;})()":true,"typeof new RegExp('x')":"object","'a'==('a'[0])":true,"(function(){var a;if(0)function a(){}return void 0===a;})()":true,"typeof ({}).__proto__":"object","document.body.setAttribute.length === 2":true,"eval(\"'\u200d'\").length === 1":true,"'a,,a'.split(',').length === 3":true} +{"navigator.userAgent":"Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.0.5) Gecko/2008120122 Firefox/3.0.5 (.NET CLR 3.5.30729)",
+"navigator.appName":"Netscape",
+"navigator.appVersion":"5.0 (Windows; en-US)",
+"navigator.platform":"Win32",
+"typeof undefined":"undefined",
+"Infinity === 1/0":true,
+"isNaN(NaN)":true,
+"!!this.window && this === window":true,
+"!(function () { return this; }.call(null))":false,
+"typeof JSON":"undefined",
+"typeof addEventListener":"function",
+"typeof attachEvent":"undefined",
+"!!window.attachEvent":false,
+"typeof document.getElementsByClassName":"function",
+"typeof document.documentElement.getElementsByClassName":"function",
+"!!document.all":false,
+"typeof Date.now":"function",
+"(function(){try{return(document.createElement('<input type=\"radio\">').type === 'radio');}catch(e){return(false);}})()":false,
+"typeof document.createElement('style').styleSheet":"undefined",
+"typeof document.body.style.cssText":"string",
+"typeof XMLHttpRequest":"function",
+"typeof ActiveXObject":"undefined",
+"typeof getComputedStyle":"function",
+"typeof document.body.currentStyle":"undefined",
+"!!document.body.currentStyle":false,
+"typeof document.documentElement.compareDocumentPosition":"function",
+"typeof document.documentElement.contains":"undefined",
+"!!document.documentElement.contains":false,
+"typeof document.createEvent":"function",
+"typeof document.createRange":"function",
+"typeof document.documentElement.doScroll":"undefined",
+"!!typeof document.documentElement.doScroll":true,
+"typeof document.documentElement.getBoundingClientRect":"function",
+"!!document.documentElement.getBoundingClientRect":true,
+"\"sourceIndex\" in document.documentElement":false,
+"typeof document.createEventObject":"undefined",
+"!!document.createEventObject":false,
+"typeof Date.prototype.toISOString":"undefined",
+"typeof Date.prototype.toJSON":"undefined",
+"typeof Array.slice":"function",
+"typeof Function.prototype.bind":"undefined",
+"typeof Object.prototype.toSource":"function",
+"typeof uneval":"function",
+"void 0 === ((function(){})[-2])":false,
+"void 0 === ((function(){var b,a=function b(){};return b;})())":true,
+"(function(){var e=true;try{throw false;}catch(e){}return e;})()":true,
+"typeof new RegExp('x')":"object",
+"'a'==('a'[0])":true,
+"(function(){var a;if(0)function a(){}return void 0===a;})()":true,
+"typeof ({}).__proto__":"object",
+"document.body.setAttribute.length === 2":true,
+"eval(\"'\u200d'\").length === 1":true,
+"'a,,a'.split(',').length === 3":true}
=======================================
--- /trunk/src/com/google/caja/ancillary/opt/Firefox-3.5.3.env.json Mon Oct 26 18:40:33 2009 +++ /trunk/src/com/google/caja/ancillary/opt/Firefox-3.5.3.env.json Wed Nov 11 12:20:11 2009
@@ -1,1 +1,53 @@
-{"navigator.userAgent":"Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10.5; en-US; rv:1.9.1.3) Gecko/20090824 Firefox/3.5.3","navigator.appName":"Netscape","navigator.appVersion":"5.0 (Macintosh; en-US)","navigator.platform":"MacIntel","!(function(){return this;}.call(null))":false,"typeof JSON":"object","typeof addEventListener":"function","typeof attachEvent":"undefined","typeof document.getElementsByClassName":"function","typeof Date.now":"function","(function(){try{return(document.createElement('<input type=\"radio\">').type === 'radio');}catch(e){return(false);}})()":false,"typeof document.createElement('style').styleSheet":"undefined","typeof document.body.style.cssText":"string","typeof XMLHttpRequest":"function","typeof ActiveXObject":"undefined","typeof getComputedStyle":"function","typeof document.body.currentStyle":"undefined","typeof document.documentElement.compareDocumentPosition":"function","typeof document.documentElement.contains":"undefined","typeof document.createEvent":"function","typeof document.createEventObject":"undefined","typeof Date.prototype.toISOString":"function","typeof Date.prototype.toJSON":"function","typeof Array.slice":"function","typeof Function.prototype.bind":"undefined","void 0 === ((function(){})[-2])":true,"void 0 === ((function(){var b,a=function b(){};return b;})())":true,"(function(){var e=true;try{throw false;}catch(e){}return e;})()":true,"typeof new RegExp('x')":"object","'a'==('a'[0])":true,"(function(){var a;if(0)function a(){}return void 0===a;})()":true,"typeof ({}).__proto__":"object","document.body.setAttribute.length === 2":true,"eval(\"'‍'\").length === 1":true,"'a,,a'.split(',').length === 3":true} +{"navigator.userAgent":"Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10.5; en-US; rv:1.9.1.3) Gecko/20090824 Firefox/3.5.3",
+"navigator.appName":"Netscape",
+"navigator.appVersion":"5.0 (Macintosh; en-US)",
+"navigator.platform":"MacIntel",
+"typeof undefined":"undefined",
+"Infinity === 1/0":true,
+"isNaN(NaN)":true,
+"!!this.window && this === window":true,
+"!(function () { return this; }.call(null))":false,
+"typeof JSON":"object",
+"typeof addEventListener":"function",
+"typeof attachEvent":"undefined",
+"!!window.attachEvent":false,
+"typeof document.getElementsByClassName":"function",
+"typeof document.documentElement.getElementsByClassName":"function",
+"!!document.all":false,
+"typeof Date.now":"function",
+"(function(){try{return(document.createElement('<input type=\"radio\">').type === 'radio');}catch(e){return(false);}})()":false,
+"typeof document.createElement('style').styleSheet":"undefined",
+"typeof document.body.style.cssText":"string",
+"typeof XMLHttpRequest":"function",
+"typeof ActiveXObject":"undefined",
+"typeof getComputedStyle":"function",
+"typeof document.body.currentStyle":"undefined",
+"!!document.body.currentStyle":false,
+"typeof document.documentElement.compareDocumentPosition":"function",
+"typeof document.documentElement.contains":"undefined",
+"!!document.documentElement.contains":false,
+"typeof document.createEvent":"function",
+"typeof document.createRange":"function",
+"typeof document.documentElement.doScroll":"undefined",
+"!!typeof document.documentElement.doScroll":true,
+"typeof document.documentElement.getBoundingClientRect":"function",
+"!!document.documentElement.getBoundingClientRect":true,
+"\"sourceIndex\" in document.documentElement":false,
+"typeof document.createEventObject":"undefined",
+"!!document.createEventObject":false,
+"typeof Date.prototype.toISOString":"function",
+"typeof Date.prototype.toJSON":"function",
+"typeof Array.slice":"function",
+"typeof Function.prototype.bind":"undefined",
+"typeof Object.prototype.toSource":"function",
+"typeof uneval":"function",
+"void 0 === ((function(){})[-2])":true,
+"void 0 === ((function(){var b,a=function b(){};return b;})())":true,
+"(function(){var e=true;try{throw false;}catch(e){}return e;})()":true,
+"typeof new RegExp('x')":"object",
+"'a'==('a'[0])":true,
+"(function(){var a;if(0)function a(){}return void 0===a;})()":true,
+"typeof ({}).__proto__":"object",
+"document.body.setAttribute.length === 2":true,
+"eval(\"'\u200d'\").length === 1":true,
+"'a,,a'.split(',').length === 3":true}
=======================================
--- /trunk/src/com/google/caja/ancillary/opt/MSIE-6.0.env.json Mon Oct 26 18:40:33 2009 +++ /trunk/src/com/google/caja/ancillary/opt/MSIE-6.0.env.json Wed Nov 11 12:20:11 2009
@@ -1,1 +1,43 @@
-{"navigator.userAgent":"Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1; .NET CLR 2.0.50727; .NET CLR 1.1.4322; .NET CLR 3.0.04506.648; .NET CLR 3.5.21022; .NET CLR 3.0.4506.2152; .NET CLR 3.5.30729)","navigator.appName":"Microsoft Internet Explorer","navigator.appVersion":"4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1; .NET CLR 2.0.50727; .NET CLR 1.1.4322; .NET CLR 3.0.04506.648; .NET CLR 3.5.21022; .NET CLR 3.0.4506.2152; .NET CLR 3.5.30729)","navigator.platform":"Win32","!(function(){return this;}.call(null))":false,"typeof JSON":"undefined","typeof addEventListener":"undefined","typeof attachEvent":"object","typeof document.getElementsByClassName":"undefined","typeof Date.now":"undefined","(function(){try{return(document.createElement('<input type=\"radio\">').type === 'radio');}catch(e){return(false);}})()":true,"typeof document.createElement('style').styleSheet":"object","typeof document.body.style.cssText":"string","typeof XMLHttpRequest":"undefined","typeof ActiveXObject":"function","typeof getComputedStyle":"undefined","typeof document.body.currentStyle":"object","typeof document.documentElement.compareDocumentPosition":"undefined","typeof document.documentElement.contains":"object","typeof document.createEvent":"undefined","typeof document.createEventObject":"object","typeof Date.prototype.toISOString":"undefined","typeof Date.prototype.toJSON":"undefined","typeof Array.slice":"undefined","typeof Function.prototype.bind":"undefined","void 0 === ((function(){})[-2])":true,"void 0 === ((function(){var b,a=function b(){};return b;})())":false,"(function(){var e=true;try{throw false;}catch(e){}return e;})()":false,"typeof new RegExp('x')":"object","'a'==('a'[0])":false,"(function(){var a;if(0)function a(){}return void 0===a;})()":false,"typeof ({}).__proto__":"undefined","document.body.setAttribute.length === 2":false,"eval(\"'\u200d'\").length === 1":true,"'a,,a'.split(',').length === 3":true} +{"navigator.userAgent":"Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1; .NET CLR 2.0.50727; .NET CLR 1.1.4322; .NET CLR 3.0.04506.648; .NET CLR 3.5.21022; .NET CLR 3.0.4506.2152; .NET CLR 3.5.30729)",
+"navigator.appName":"Microsoft Internet Explorer",
+"navigator.appVersion":"4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1; .NET CLR 2.0.50727; .NET CLR 1.1.4322; .NET CLR 3.0.04506.648; .NET CLR 3.5.21022; .NET CLR 3.0.4506.2152; .NET CLR 3.5.30729)",
+"navigator.platform":"Win32","typeof undefined":"undefined",
+"Infinity === 1/0":true,"isNaN(NaN)":true,"!!this.window && this === window":true, +"!(function () { return this; }.call(null))":false,"typeof JSON":"undefined",
+"typeof addEventListener":"undefined","typeof attachEvent":"object",
+"!!window.attachEvent":true,
+"typeof document.getElementsByClassName":"undefined",
+"typeof document.documentElement.getElementsByClassName":"undefined",
+"!!document.all":true,"typeof Date.now":"undefined",
+"(function(){try{return(document.createElement('<input type=\"radio\">').type === 'radio');}catch(e){return(false);}})()":true,
+"typeof document.createElement('style').styleSheet":"object",
+"typeof document.body.style.cssText":"string",
+"typeof XMLHttpRequest":"undefined","typeof ActiveXObject":"function",
+"typeof getComputedStyle":"undefined",
+"typeof document.body.currentStyle":"object",
+"!!document.body.currentStyle":true,
+"typeof document.documentElement.compareDocumentPosition":"undefined",
+"typeof document.documentElement.contains":"object",
+"!!document.documentElement.contains":true,
+"typeof document.createEvent":"undefined",
+"typeof document.createRange":"undefined",
+"typeof document.documentElement.doScroll":"object",
+"!!typeof document.documentElement.doScroll":true,
+"typeof document.documentElement.getBoundingClientRect":"object",
+"!!document.documentElement.getBoundingClientRect":true,
+"\"sourceIndex\" in document.documentElement":true,
+"typeof document.createEventObject":"object",
+"!!document.createEventObject":true,
+"typeof Date.prototype.toISOString":"undefined",
+"typeof Date.prototype.toJSON":"undefined","typeof Array.slice":"undefined",
+"typeof Function.prototype.bind":"undefined",
+"typeof Object.prototype.toSource":"undefined","typeof uneval":"undefined",
+"void 0 === ((function(){})[-2])":true,
+"void 0 === ((function(){var b,a=function b(){};return b;})())":false,
+"0 === (function () { var toString = 0; return (function () { return toString; })(); })()":true,
+"(function(){var e=true;try{throw false;}catch(e){}return e;})()":false,
+"typeof new RegExp('x')":"object","'a'==('a'[0])":false,
+"(function(){var a;if(0)function a(){}return void 0===a;})()":false,
+"typeof ({}).__proto__":"undefined",
+"document.body.setAttribute.length === 2":false,
+"eval(\"'\u200d'\").length === 1":true,"'a,,a'.split(',').length === 3":true}
=======================================
--- /trunk/src/com/google/caja/ancillary/opt/Safari-531.9.env.json Mon Oct 26 18:40:33 2009 +++ /trunk/src/com/google/caja/ancillary/opt/Safari-531.9.env.json Wed Nov 11 12:20:11 2009
@@ -1,1 +1,47 @@
-{"navigator.userAgent":"Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10_5_8; en-us) AppleWebKit/531.9 (KHTML, like Gecko) Version/4.0.3 Safari/531.9","navigator.appName":"Netscape","navigator.appVersion":"5.0 (Macintosh; U; Intel Mac OS X 10_5_8; en-us) AppleWebKit/531.9 (KHTML, like Gecko) Version/4.0.3 Safari/531.9","navigator.platform":"MacIntel","!(function(){return this;}.call(null))":false,"typeof JSON":"object","typeof addEventListener":"function","typeof attachEvent":"undefined","typeof document.getElementsByClassName":"function","typeof Date.now":"function","(function(){try{return(document.createElement('<input type=\"radio\">').type === 'radio');}catch(e){return(false);}})()":false,"typeof document.createElement('style').styleSheet":"undefined","typeof document.body.style.cssText":"string","typeof XMLHttpRequest":"object","typeof ActiveXObject":"undefined","typeof getComputedStyle":"function","typeof document.body.currentStyle":"undefined","typeof document.documentElement.compareDocumentPosition":"function","typeof document.documentElement.contains":"function","typeof document.createEvent":"function","typeof document.createEventObject":"undefined","typeof Date.prototype.toISOString":"function","typeof Date.prototype.toJSON":"function","typeof Array.slice":"undefined","typeof Function.prototype.bind":"undefined","void 0 === ((function(){})[-2])":true,"void 0 === ((function(){var b,a=function b(){};return b;})())":true,"(function(){var e=true;try{throw false;}catch(e){}return e;})()":true,"typeof new RegExp('x')":"function","'a'==('a'[0])":true,"(function(){var a;if(0)function a(){}return void 0===a;})()":false,"typeof ({}).__proto__":"object","document.body.setAttribute.length === 2":true,"eval(\"'‍'\").length === 1":true,"'a,,a'.split(',').length === 3":true} +{"navigator.userAgent":"Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10_5_8; en-us) AppleWebKit/531.9 (KHTML, like Gecko) Version/4.0.3 Safari/531.9",
+"navigator.appName":"Netscape",
+"navigator.appVersion":"5.0 (Macintosh; U; Intel Mac OS X 10_5_8; en-us) AppleWebKit/531.9 (KHTML, like Gecko) Version/4.0.3 Safari/531.9",
+"navigator.platform":"MacIntel",
+"typeof undefined":"undefined",
+"Infinity === 1/0":true,
+"isNaN(NaN)":true,
+"!!this.window && this === window":true,
+"!(function () { return this; }.call(null))":false,
+"typeof JSON":"object",
+"typeof addEventListener":"function",
+"typeof attachEvent":"undefined",
+"typeof document.getElementsByClassName":"function",
+"typeof document.documentElement.getElementsByClassName":"function",
+"!!document.all":false,
+"typeof Date.now":"function",
+"(function(){try{return(document.createElement('<input type=\"radio\">').type === 'radio');}catch(e){return(false);}})()":false,
+"typeof document.createElement('style').styleSheet":"undefined",
+"typeof document.body.style.cssText":"string",
+"typeof XMLHttpRequest":"object",
+"typeof ActiveXObject":"undefined",
+"typeof getComputedStyle":"function",
+"typeof document.body.currentStyle":"undefined",
+"typeof document.documentElement.compareDocumentPosition":"function",
+"typeof document.documentElement.contains":"function",
+"typeof document.createEvent":"function",
+"typeof document.createRange":"function",
+"typeof document.doScroll":"undefined",
+"typeof document.documentElement.getBoundingClientRect":"function",
+"\"sourceIndex\" in document.documentElement":false,
+"typeof document.createEventObject":"undefined",
+"typeof Date.prototype.toISOString":"function",
+"typeof Date.prototype.toJSON":"function",
+"typeof Array.slice":"undefined",
+"typeof Function.prototype.bind":"undefined",
+"typeof Object.prototype.toSource":"undefined",
+"typeof uneval":"undefined",
+"void 0 === ((function(){})[-2])":true,
+"void 0 === ((function(){var b,a=function b(){};return b;})())":true,
+"(function(){var e=true;try{throw false;}catch(e){}return e;})()":true,
+"typeof new RegExp('x')":"function",
+"'a'==('a'[0])":true,
+"(function(){var a;if(0)function a(){}return void 0===a;})()":false,
+"typeof ({}).__proto__":"object",
+"document.body.setAttribute.length === 2":true,
+"eval(\"'\u200d'\").length === 1":true,
+"'a,,a'.split(',').length === 3":true}
=======================================
--- /trunk/src/com/google/caja/ancillary/opt/environment-checks.html Mon Oct 26 18:40:33 2009 +++ /trunk/src/com/google/caja/ancillary/opt/environment-checks.html Wed Nov 11 12:20:11 2009
@@ -28,50 +28,49 @@
 <body style="width:80em; font-family: monospace; white-space: pre-wrap"
 ><script src=environment-checks.js></script><script>
 (function () {
-  var envJson;
- if (typeof JSON !== 'undefined' && typeof JSON.stringify === 'function') {
-    envJson = JSON.stringify(env);
-  } else {
-    var prefixes = ['\\x00', '\\x0', '\\x', '\\u0', '\\u'];
-    function hex(ch) {
-      var hex = ch.charCodeAt(0).toString(16);
-      return prefixes[hex.length] + hex;
-    }
-    function stringify(json) {
-      if (json === null) { return 'null'; }
-      switch (typeof json) {
-        case 'boolean': return json ? 'true' : 'false';
-        case 'number':
-          if (isNaN(json) || isInfinite(json)) {
-            throw new Error(json);
-          }
+  var prefixes = ['\\x00', '\\x0', '\\x', '\\u0', '\\u'];
+  function hex(ch) {
+    var hex = ch.charCodeAt(0).toString(16);
+    return prefixes[hex.length] + hex;
+  }
+  function stringify(json) {
+    if (json === null) { return 'null'; }
+    switch (typeof json) {
+      case 'boolean': return json ? 'true' : 'false';
+      case 'number':
+        if (isNaN(json) || isInfinite(json)) {
+          throw new Error(json);
+        }
+        if (json === 0) {
+          return (1/json) < 0 ? '-0' : '0';
+        } else {
           return '' + json;
-        case 'string':
-          return '\x22' + json.replace(/[\x22\\]/g, '\\$&')
-              .replace(/[^\x20-\x7e]/g, hex) + '\x22';
-        case 'object':
-          switch (Object.prototype.toString.call(json)) {
-            case '[object Array]':
-              var els = [];
-              for (var i = json.length; --i != 0;) {
-                els[i] = stringify(json[i]);
-              }
-              return '[' + els + ']';
-            case '[object Object]':
-              var pairs = [];
-              for (var k in json) {
-                if (Object.prototype.hasOwnProperty.call(json, k)) {
-                  pairs.push(stringify(k) + ':' + stringify(json[k]));
-                }
-              }
-              return '{' + pairs + '}';
-          }
-          break;
-      }
-      throw new Error('' + json + ' : ' + typeof json);
-    }
-    envJson = stringify(env);
-  }
+        }
+      case 'string':
+        return '\x22' + json.replace(/[\x22\\]/g, '\\$&')
+            .replace(/[^\x20-\x7e]/g, hex) + '\x22';
+      case 'object':
+        switch (Object.prototype.toString.call(json)) {
+          case '[object Array]':
+            var els = [];
+            for (var i = json.length; --i != 0;) {
+              els[i] = stringify(json[i]);
+            }
+            return '[' + els + ']';
+          case '[object Object]':
+            var pairs = [];
+            for (var k in json) {
+              if (Object.prototype.hasOwnProperty.call(json, k)) {
+                pairs.push(stringify(k) + ':' + stringify(json[k]));
+              }
+            }
+            return '{' + pairs.join(',\n') + '}';
+        }
+        break;
+    }
+    throw new Error('' + json + ' : ' + typeof json);
+  }
+  var envJson = stringify(env);
   document.body.appendChild(document.createTextNode(envJson));
 })();
 </script>
=======================================
--- /trunk/src/com/google/caja/ancillary/opt/environment-checks.js Mon Oct 26 18:40:33 2009 +++ /trunk/src/com/google/caja/ancillary/opt/environment-checks.js Wed Nov 11 12:20:11 2009
@@ -45,13 +45,23 @@
       'navigator.appName',
       'navigator.appVersion',
       'navigator.platform',
+      // Check ES global definitions
+      'typeof undefined',
+      'Infinity === 1/0',
+      'NaN !== NaN',
+      //// Does window alias the global object?
+      '!!this.window && this === window',
       //// Is EcmaScript 5 strict mode present?
-      '!(function(){return this;}.call(null))',
+      '!(function () { return this; }.call(null))',
       //// Check whether native implementations are available
       'typeof JSON',
       'typeof addEventListener',
+      // IE makes a lot of its functions, objects.
+      // Fun fact: but not ActiveXObject.
       'typeof attachEvent',
+      '!!window.attachEvent',
       'typeof document.getElementsByClassName',
+      'typeof document.documentElement.getElementsByClassName',
       '!!document.all',
       'typeof Date.now',
       // Is the extended createElement syntax available?
@@ -65,19 +75,35 @@
       'typeof ActiveXObject',
       'typeof getComputedStyle',
       'typeof document.body.currentStyle',
+      '!!document.body.currentStyle',
       'typeof document.documentElement.compareDocumentPosition',
       'typeof document.documentElement.contains',
+      '!!document.documentElement.contains',
       'typeof document.createEvent',
+      'typeof document.createRange',
+      'typeof document.documentElement.doScroll',
+      '!!typeof document.documentElement.doScroll',
+      'typeof document.documentElement.getBoundingClientRect',
+      '!!document.documentElement.getBoundingClientRect',
+      '"sourceIndex" in document.documentElement',
       'typeof document.createEventObject',
+      '!!document.createEventObject',
       'typeof Date.prototype.toISOString',
       'typeof Date.prototype.toJSON',
       'typeof Array.slice',
       'typeof Function.prototype.bind',
+      'typeof Object.prototype.toSource',
+      'typeof uneval',
       //// Check for known bugs and inconsistencies
       // Do functions not leak dangerous info in negative indices?
       'void 0 === ((function(){})[-2])',
       // Do function expressions not muck with the local scope?
       'void 0 === ((function(){var b,a=function b(){};return b;})())',
+      // Do function scope frames inherit from Object.prototype?
+ // http://yura.thinkweb2.com/named-function-expressions/#spidermonkey-peculiarity
+      ('0 === (function () {'
+       + ' var toString = 0; return (function () { return toString; })();'
+       + ' })()'),
       // Do exceptions scope properly?
       '(function(){var e=true;try{throw false;}catch(e){}return e;})()',
       // Are regex functions or objects?

Reply via email to