js/src/jit-test/tests/arguments/testDelArg3.js

Thu, 15 Jan 2015 15:59:08 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Thu, 15 Jan 2015 15:59:08 +0100
branch
TOR_BUG_9701
changeset 10
ac0c01689b40
permissions
-rw-r--r--

Implement a real Private Browsing Mode condition by changing the API/ABI;
This solves Tor bug #9701, complying with disk avoidance documented in
https://www.torproject.org/projects/torbrowser/design/#disk-avoidance.

     1 function assertGood(x) {
     2     assertEq(x, "good");
     3 }
     5 (function() {
     6     var a = arguments;
     7     return function() {
     8         assertGood.apply(null, a);
     9     }
    10 })("good")();
    12 (function() {
    13     var a = arguments;
    14     return function() {
    15         a[0] = "good";
    16         assertGood.apply(null, a);
    17     }
    18 })("bad")();
    20 Object.prototype[0] = "good";
    22 (function() {
    23     var a = arguments;
    24     return function() {
    25         delete a[0];
    26         assertGood.apply(null, a);
    27     }
    28 })("bad")();
    30 delete Object.prototype[0];
    32 function assertUndefined(x) {
    33     assertEq(x, undefined);
    34 }
    36 (function() {
    37     var a = arguments;
    38     return function() {
    39         a[0] = "bad";
    40         assertUndefined.apply(null, a);
    41     }
    42 })()();

mercurial