js/src/tests/js1_7/lexical/regress-346642-03.js

Sat, 03 Jan 2015 20:18:00 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Sat, 03 Jan 2015 20:18:00 +0100
branch
TOR_BUG_3246
changeset 7
129ffea94266
permissions
-rw-r--r--

Conditionally enable double key logic according to:
private browsing mode or privacy.thirdparty.isolate preference and
implement in GetCookieStringCommon and FindCookie where it counts...
With some reservations of how to convince FindCookie users to test
condition and pass a nullptr when disabling double key logic.

michael@0 1 // |reftest| skip -- obsolete test
michael@0 2 /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
michael@0 3 /* This Source Code Form is subject to the terms of the Mozilla Public
michael@0 4 * License, v. 2.0. If a copy of the MPL was not distributed with this
michael@0 5 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
michael@0 6
michael@0 7 //-----------------------------------------------------------------------------
michael@0 8 var BUGNUMBER = 346642;
michael@0 9 var summary = 'decompilation of destructuring assignment';
michael@0 10 var actual = '';
michael@0 11 var expect = '';
michael@0 12
michael@0 13
michael@0 14 //-----------------------------------------------------------------------------
michael@0 15 test();
michael@0 16 //-----------------------------------------------------------------------------
michael@0 17
michael@0 18 function test()
michael@0 19 {
michael@0 20 enterFunc ('test');
michael@0 21 printBugNumber(BUGNUMBER);
michael@0 22 printStatus (summary);
michael@0 23
michael@0 24 expect = 'TypeError: NaN is not a constructor';
michael@0 25 actual = 'No Crash';
michael@0 26 try
michael@0 27 {
michael@0 28 try { throw 1; } catch(e1 if 0) { } catch(e2 if (new NaN)) { }
michael@0 29 }
michael@0 30 catch(ex)
michael@0 31 {
michael@0 32 actual = ex + '';
michael@0 33 }
michael@0 34 reportCompare(expect, actual, summary + ': 1');
michael@0 35
michael@0 36 expect = /TypeError: x.t (has no properties|is undefined)/;
michael@0 37 actual = 'No Crash';
michael@0 38 try
michael@0 39 {
michael@0 40 z = [1];
michael@0 41 let (x = (undefined ? 3 : z)) { x.t.g }
michael@0 42 }
michael@0 43 catch(ex)
michael@0 44 {
michael@0 45 actual = ex + '';
michael@0 46 }
michael@0 47 reportMatch(expect, actual, summary + ': 2');
michael@0 48
michael@0 49 expect = /TypeError: x.t (has no properties|is undefined)/;
michael@0 50 actual = 'No Crash';
michael@0 51 try
michael@0 52 {
michael@0 53 z = [1];
michael@0 54 new Function("let (x = (undefined ? 3 : z)) { x.t.g }")()
michael@0 55 }
michael@0 56 catch(ex)
michael@0 57 {
michael@0 58 actual = ex + '';
michael@0 59 }
michael@0 60 reportMatch(expect, actual, summary + ': 3');
michael@0 61
michael@0 62 expect = 'TypeError: b is not a constructor';
michael@0 63 actual = 'No Crash';
michael@0 64 try
michael@0 65 {
michael@0 66 with({x: (new (b = 1))}) (2).x
michael@0 67 }
michael@0 68 catch(ex)
michael@0 69 {
michael@0 70 actual = ex + '';
michael@0 71 }
michael@0 72 reportCompare(expect, actual, summary + ': 4');
michael@0 73
michael@0 74 expect = /TypeError: this.zzz (has no properties|is undefined)/;
michael@0 75 actual = 'No Crash';
michael@0 76 try
michael@0 77 {
michael@0 78 (function(){try { } catch(f) { return; } finally { this.zzz.zzz }})();
michael@0 79 }
michael@0 80 catch(ex)
michael@0 81 {
michael@0 82 actual = ex + '';
michael@0 83 }
michael@0 84 reportMatch(expect, actual, summary + ': 5');
michael@0 85
michael@0 86 expect = 'TypeError: p.z = <x><y/></x> ? 3 : 4 is not a function';
michael@0 87 actual = 'No Crash';
michael@0 88 try
michael@0 89 {
michael@0 90 (new Function("if(\n({y:5, p: (print).r})) { p={}; (p.z = <x\n><y/></x> ? 3 : 4)(5) }"))();
michael@0 91 }
michael@0 92 catch(ex)
michael@0 93 {
michael@0 94 actual = ex + '';
michael@0 95 }
michael@0 96 reportCompare(expect, actual, summary + ': 6');
michael@0 97
michael@0 98 expect = 'TypeError: xx is not a function';
michael@0 99 actual = 'No Crash';
michael@0 100 try
michael@0 101 {
michael@0 102 switch(xx) { case 3: case (new ([3].map)): } const xx;
michael@0 103 }
michael@0 104 catch(ex)
michael@0 105 {
michael@0 106 actual = ex + '';
michael@0 107 }
michael@0 108 reportCompare(expect, actual, summary + ': 7');
michael@0 109
michael@0 110 expect = 'TypeError: ++x is not a function';
michael@0 111 actual = 'No Crash';
michael@0 112 try
michael@0 113 {
michael@0 114 let (x=3) ((++x)())
michael@0 115 }
michael@0 116 catch(ex)
michael@0 117 {
michael@0 118 actual = ex + '';
michael@0 119 }
michael@0 120 reportCompare(expect, actual, summary + ': 8');
michael@0 121
michael@0 122 expect = 'ReferenceError: x.y is not defined';
michael@0 123 actual = 'No Crash';
michael@0 124 try
michael@0 125 {
michael@0 126 x = {};
michael@0 127 import x.y;
michael@0 128 }
michael@0 129 catch(ex)
michael@0 130 {
michael@0 131 actual = ex + '';
michael@0 132 }
michael@0 133 reportCompare(expect, actual, summary + ': 9');
michael@0 134
michael@0 135 exitFunc ('test');
michael@0 136 }

mercurial