Reviewers: kpreid2,

Description:
A test to check whether a frozen object's __proto__ property was mutable
was returning a symptom in the case of correct behavior, namely
silently ignoring the assignment.  This corrects the symptom report to
a simple "false".

Please review this at https://codereview.appspot.com/6851128/

Affected files:
  M     src/com/google/caja/ses/repairES5.js


Index: src/com/google/caja/ses/repairES5.js
===================================================================
--- src/com/google/caja/ses/repairES5.js        (revision 5169)
+++ src/com/google/caja/ses/repairES5.js        (working copy)
@@ -1471,7 +1471,7 @@
       return 'Mutating __proto__ failed with: ' + err;
     }
     if (y.isPrototypeOf(x)) { return true; }
-    return 'Mutating __proto__ neither failed nor succeeded';
+    return (x.__proto__ !== Object.prototype);
   }

   /**
@@ -1495,7 +1495,7 @@
       return 'Defining __proto__ failed with: ' + err;
     }
     if (y.isPrototypeOf(x)) { return true; }
-    return 'Defining __proto__ neither failed nor succeeded';
+    return (x.__proto__ !== Object.prototype);
   }

   /**


Reply via email to