Revision: 5488
Author: erights
Date: Sun Jul 14 18:32:11 2013
Log: Various tests and repairs motivated by opera specific misbehaviors
https://codereview.appspot.com/10923044
With these changes, Opera mobile 12.10 is recognized as
SES-safe and Opera 12.15 fails cleanly as unsupported. As for
Opera 15, it is based on a safe version of v8 and so is unaffected
by this CL.
[email protected]
http://code.google.com/p/google-caja/source/detail?r=5488
Modified:
/trunk/src/com/google/caja/ses/repairES5.js
=======================================
--- /trunk/src/com/google/caja/ses/repairES5.js Sat Jul 13 08:35:24 2013
+++ /trunk/src/com/google/caja/ses/repairES5.js Sun Jul 14 18:32:11 2013
@@ -844,6 +844,27 @@
function test_MISSING_GETOWNPROPNAMES() {
return !('getOwnPropertyNames' in Object);
}
+
+ /**
+ * If you can, see Opera bug [email protected].
+ *
+ * <p>On some Operas, the Object.prototype.__proto__ property is an
+ * accessor property, but the property descriptor of that property
+ * has a setter, i.e., {@code desc.set}, which throws a TypeError
+ * when one tries to read it. Unfortunately, this creates
+ * problems beyond our attempts at support.
+ */
+ function test_PROTO_SETTER_UNGETTABLE() {
+ var desc =
Object.getOwnPropertyDescriptor(Object.prototype, '__proto__');
+ if (!desc) { return false; }
+ try {
+ void desc.set; // yes, just reading it
+ } catch (err) {
+ if (err instanceof TypeError) { return true; }
+ return ''+err;
+ }
+ return false;
+ }
function inTestFrame(callback) {
if (!document || !document.createElement) { return undefined; }
@@ -1994,6 +2015,10 @@
if (x.length !== 2) { return 'Unexpected modification of frozen
array'; }
if (x[0] === 1 && x[1] === 2) { return false; }
}
+ if (x.length === 1 && x[0] === 1 && x[1] === 2) {
+ // Behavior seen on Opera 12.10 mobile and 12.15
+ return true;
+ }
if (x.length !== 2) {
return 'Unexpected silent modification of frozen array';
}
@@ -3469,6 +3494,17 @@
urls: [],
sections: ['15.2.3.4'],
tests: ['15.2.3.4-0-1']
+ },
+ {
+ id: 'PROTO_SETTER_UNGETTABLE',
+ description: "Can't get Object.prototype.__proto__'s setter",
+ test: test_PROTO_SETTER_UNGETTABLE,
+ repair: void 0,
+ preSeverity: severities.NOT_SUPPORTED,
+ canRepair: false,
+ urls: ['mailto:[email protected]'],
+ sections: [],
+ tests: []
}
];
--
---
You received this message because you are subscribed to the Google Groups "Google Caja Discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
For more options, visit https://groups.google.com/groups/opt_out.