Index: test/intl/utils.js |
diff --git a/src/extensions/i18n/header.js b/test/intl/utils.js |
similarity index 80% |
copy from src/extensions/i18n/header.js |
copy to test/intl/utils.js |
index 1c0a2d8874b5aa982ca2be2fb39f2ead1c4a9622..431f2ea184d2a5aa2212dd313636376c77eff05b 100644 |
--- a/src/extensions/i18n/header.js |
+++ b/test/intl/utils.js |
@@ -26,16 +26,16 @@ |
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
// limitations under the License. |
-// ECMAScript 402 API implementation is broken into separate files for |
-// each service. The build system combines them together into one |
-// Intl namespace. |
- |
/** |
- * Intl object is a single object that has some named properties, |
- * all of which are constructors. |
+ * Taints properties on Object.prototype so we can find security issues. |
*/ |
-var Intl = (function() { |
- |
-'use strict'; |
- |
-var Intl = {}; |
+function taintProperties(properties) { |
+ properties.forEach(function(property) { |
+ Object.defineProperty(Object.prototype, property, { |
+ set: function(value) { |
+ throw new Error('Property ' + property + ' is compromised. ' + |
+ 'Setting value: ' + value); |
+ } |
+ }); |
+ }); |
+} |