Debian Codegraph @

rhino/testsrc/tests/ecma_3/Statements/regress-444979.js

raw symbols SCIP
1 /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
2 /* This Source Code Form is subject to the terms of the Mozilla Public
3 * License, v. 2.0. If a copy of the MPL was not distributed with this
4 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
5
6 var gTestfile = 'regress-444979.js';
7 //-----------------------------------------------------------------------------
8 var BUGNUMBER = 444979;
9 var summary = 'switch -0 is same as switch 0';
10 var actual = '';
11 var expect = '';
12
13
14 //-----------------------------------------------------------------------------
15 test();
16 //-----------------------------------------------------------------------------
17
18 function test()
19 {
20 enterFunc ('test');
21 printBugNumber(BUGNUMBER);
22 printStatus (summary);
23
24 expect = 'y==0';
25 actual = '';
26
27 var shortSwitch = 'var y=-0;switch (y){case 0: actual="y==0"; break; default: actual="y!=0";}';
28 eval(shortSwitch);
29
30 reportCompare(expect, actual, summary + ': shortSwitch');
31
32 actual = '';
33
34 var longSwitch = 'var y=-0;var t=0;switch(y){case -1:';
35 for (var i = 0; i < 64000; i++) {
36 longSwitch += ' t++;';
37 }
38 longSwitch += ' break; case 0: actual = "y==0"; break; default: actual = "y!=0";}';
39 eval(longSwitch);
40
41 reportCompare(expect, actual, summary + ': longSwitch');
42
43 exitFunc ('test');
44 }