js/src/jit-test/tests/parser/truncation.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 load(libdir + "asserts.js");
     3 var cases = [
     4     "{",
     5     "{ ;",
     6     "var",
     7     "var x,",
     8     "var x =",
     9     "let",
    10     "let x,",
    11     "let x =",
    12     "const",
    13     "const x =",
    14     "const x = 1,",
    15     "if",
    16     "if (",
    17     "if (0) ; else",
    18     "do",
    19     "do ;",
    20     "do ; while",
    21     "do ; while (",
    22     "do ; while (1",
    23     "while",
    24     "while (",
    25     "while (1",
    26     "while (1)",
    27     "for",
    28     "for (",
    29     "for (;",
    30     "for (;;",
    31     "for (;;)",
    32     "for (var",
    33     "for (x",
    34     "for (x in",
    35     "for (x in y",
    36     "for (x in y)",
    37     "for (x of",
    38     "for (x of y",
    39     "for (x of y)",
    40     "switch",
    41     "switch (",
    42     "switch (x",
    43     "switch (x)",
    44     "with",
    45     "with (",
    46     "with (x",
    47     "with (x)",
    48     "a:",
    49     "throw",
    50     "try",
    51     "try {",
    52     "try {} catch",
    53     "try {} catch (",
    54     "try {} catch (exc",
    55     "try {} catch (exc if",
    56     "try {} catch (exc if 1",
    57     "try {} finally",
    58     "try {} finally {",
    60     "function",
    61     "function f",
    62     "function f(",
    63     "function f()",
    64     "function f() {",
    65     "(function",
    66     "(function f",
    67     "(function f(",
    68     "(function f()",
    70 ];
    72 for (var s of cases)
    73     assertThrowsInstanceOf(() => Function(s), SyntaxError);

mercurial