js/src/tests/js1_8_1/regress/regress-452498-082.js

Wed, 31 Dec 2014 07:53:36 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Wed, 31 Dec 2014 07:53:36 +0100
branch
TOR_BUG_3246
changeset 5
4ab42b5ab56c
permissions
-rw-r--r--

Correct small whitespace inconsistency, lost while renaming variables.

michael@0 1 /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
michael@0 2 /* This Source Code Form is subject to the terms of the Mozilla Public
michael@0 3 * License, v. 2.0. If a copy of the MPL was not distributed with this
michael@0 4 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
michael@0 5
michael@0 6 //-----------------------------------------------------------------------------
michael@0 7 var BUGNUMBER = 452498;
michael@0 8 var summary = 'TM: upvar2 regression tests';
michael@0 9 var actual = '';
michael@0 10 var expect = '';
michael@0 11
michael@0 12
michael@0 13 //-----------------------------------------------------------------------------
michael@0 14 test();
michael@0 15 //-----------------------------------------------------------------------------
michael@0 16
michael@0 17 function test()
michael@0 18 {
michael@0 19 enterFunc ('test');
michael@0 20 printBugNumber(BUGNUMBER);
michael@0 21 printStatus (summary);
michael@0 22
michael@0 23 // ------- Comment #82 From Gary Kwong [:nth10sd]
michael@0 24
michael@0 25 // =====
michael@0 26
michael@0 27 (function(){function x(){} {let x = [] }});
michael@0 28
michael@0 29 // =====
michael@0 30
michael@0 31 var f = new Function("new function x(){ return x |= function(){} } ([], function(){})");
michael@0 32 "" + f;
michael@0 33
michael@0 34 // =====
michael@0 35
michael@0 36 uneval(function(){[y] = [x];});
michael@0 37
michael@0 38 // =====
michael@0 39
michael@0 40 function g(code)
michael@0 41 {
michael@0 42 var f = new Function(code);
michael@0 43 f();
michael@0 44 }
michael@0 45 g("for (var x = 0; x < 3; ++x)(new (function(){})());");
michael@0 46
michael@0 47 // =====
michael@0 48
michael@0 49 try
michael@0 50 {
michael@0 51 (function(){new (function ({}, x) { yield (x(1e-81) for (x4 in undefined)) })()})();
michael@0 52 }
michael@0 53 catch(ex)
michael@0 54 {
michael@0 55 }
michael@0 56 // =====
michael@0 57
michael@0 58 try
michael@0 59 {
michael@0 60 (function(){[(function ([y]) { })() for each (x in [])];})();
michael@0 61 }
michael@0 62 catch(ex)
michael@0 63 {
michael@0 64 }
michael@0 65 // =====
michael@0 66
michael@0 67 try
michael@0 68 {
michael@0 69 eval('(function(){for(var x2 = [function(id) { return id } for each (x in []) if ([])] in functional) function(){};})();');
michael@0 70 }
michael@0 71 catch(ex)
michael@0 72 {
michael@0 73 }
michael@0 74
michael@0 75 // =====
michael@0 76
michael@0 77 if (typeof window == 'undefined')
michael@0 78 global = this;
michael@0 79 else
michael@0 80 global = window;
michael@0 81
michael@0 82 try
michael@0 83 {
michael@0 84 eval('(function(){with(global){1e-81; }for(let [x, x3] = global -= x in []) function(){}})();');
michael@0 85 }
michael@0 86 catch(ex)
michael@0 87 {
michael@0 88 }
michael@0 89
michael@0 90 // =====
michael@0 91 try
michael@0 92 {
michael@0 93 eval(
michael@0 94 'for(let [\n' +
michael@0 95 'function x () { M:if([1,,]) }\n'
michael@0 96 );
michael@0 97 }
michael@0 98 catch(ex)
michael@0 99 {
michael@0 100 }
michael@0 101
michael@0 102 // =====
michael@0 103
michael@0 104 try
michael@0 105 {
michael@0 106 function foo(code)
michael@0 107 {
michael@0 108 var c;
michael@0 109 eval("const c, x5 = c;");
michael@0 110 }
michael@0 111 foo();
michael@0 112 }
michael@0 113 catch(ex)
michael@0 114 {
michael@0 115 }
michael@0 116
michael@0 117 // =====
michael@0 118
michael@0 119 var f = new Function("try { with({}) x = x; } catch(\u3056 if (function(){x = x2;})()) { let([] = [1.2e3.valueOf(\"number\")]) ((function(){})()); } ");
michael@0 120 "" + f;
michael@0 121
michael@0 122 // =====
michael@0 123
michael@0 124 var f = new Function("[] = [( '' )()];");
michael@0 125 "" + f;
michael@0 126
michael@0 127 // =====
michael@0 128
michael@0 129 try
michael@0 130 {
michael@0 131 eval(
michael@0 132 'for(let x;' +
michael@0 133 ' ([,,,]' +
michael@0 134 ' .toExponential(new Function(), (function(){}))); [] = {})' +
michael@0 135 ' for(var [x, x] = * in this.__defineSetter__("", function(){}));'
michael@0 136 );
michael@0 137 }
michael@0 138 catch(ex)
michael@0 139 {
michael@0 140 }
michael@0 141
michael@0 142 // =====
michael@0 143
michael@0 144 reportCompare(expect, actual, summary);
michael@0 145
michael@0 146 exitFunc ('test');
michael@0 147 }

mercurial