Debian Codegraph @

rhino/testsrc/tests/js1_5/Expressions/regress-192288.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 /*
7 *
8 * Date: 07 February 2003
9 * SUMMARY: Testing 0/0 inside functions
10 *
11 * See http://bugzilla.mozilla.org/show_bug.cgi?id=192288
12 *
13 */
14 //-----------------------------------------------------------------------------
15 var gTestfile = 'regress-192288.js';
16 var UBound = 0;
17 var BUGNUMBER = 192288;
18 var summary = 'Testing 0/0 inside functions ';
19 var status = '';
20 var statusitems = [];
21 var actual = '';
22 var actualvalues = [];
23 var expect= '';
24 var expectedvalues = [];
25
26
27 function f()
28 {
29 return 0/0;
30 }
31
32 status = inSection(1);
33 actual = isNaN(f());
34 expect = true;
35 addThis();
36
37 status = inSection(2);
38 actual = isNaN(f.apply(this));
39 expect = true;
40 addThis();
41
42 status = inSection(3);
43 actual = isNaN(eval("f.apply(this)"));
44 expect = true;
45 addThis();
46
47 status = inSection(4);
48 actual = isNaN(Function('return 0/0;')());
49 expect = true;
50 addThis();
51
52 status = inSection(5);
53 actual = isNaN(eval("Function('return 0/0;')()"));
54 expect = true;
55 addThis();
56
57
58
59 //-----------------------------------------------------------------------------
60 test();
61 //-----------------------------------------------------------------------------
62
63
64
65 function addThis()
66 {
67 statusitems[UBound] = status;
68 actualvalues[UBound] = actual;
69 expectedvalues[UBound] = expect;
70 UBound++;
71 }
72
73
74 function test()
75 {
76 enterFunc('test');
77 printBugNumber(BUGNUMBER);
78 printStatus(summary);
79
80 for (var i=0; i<UBound; i++)
81 {
82 reportCompare(expectedvalues[i], actualvalues[i], statusitems[i]);
83 }
84
85 exitFunc ('test');
86 }