js/src/jit-test/tests/parser/truncation.js

Wed, 31 Dec 2014 06:09:35 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Wed, 31 Dec 2014 06:09:35 +0100
changeset 0
6474c204b198
permissions
-rw-r--r--

Cloned upstream origin tor-browser at tor-browser-31.3.0esr-4.5-1-build1
revision ID fc1c9ff7c1b2defdbc039f12214767608f46423f for hacking purpose.

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

mercurial