Bug 1921963 part 1 - Use JS::ReportUncatchableException more outside the JS engine...
[gecko.git] / js / src / tests / non262 / expressions / regress-192288.js
blob80e2563bdb887b4fc59269137d2275e24ae40deb
1 /* -*- indent-tabs-mode: nil; js-indent-level: 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/. */
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 UBound = 0;
16 var BUGNUMBER = 192288;
17 var summary = 'Testing 0/0 inside functions ';
18 var status = '';
19 var statusitems = [];
20 var actual = '';
21 var actualvalues = [];
22 var expect= '';
23 var expectedvalues = [];
26 function f()
28   return 0/0;
31 status = inSection(1);
32 actual = isNaN(f());
33 expect = true;
34 addThis();
36 status = inSection(2);
37 actual = isNaN(f.apply(this));
38 expect = true;
39 addThis();
41 status = inSection(3);
42 actual = isNaN(eval("f.apply(this)"));
43 expect = true;
44 addThis();
46 status = inSection(4);
47 actual = isNaN(Function('return 0/0;')());
48 expect = true;
49 addThis();
51 status = inSection(5);
52 actual = isNaN(eval("Function('return 0/0;')()"));
53 expect = true;
54 addThis();
58 //-----------------------------------------------------------------------------
59 test();
60 //-----------------------------------------------------------------------------
64 function addThis()
66   statusitems[UBound] = status;
67   actualvalues[UBound] = actual;
68   expectedvalues[UBound] = expect;
69   UBound++;
73 function test()
75   printBugNumber(BUGNUMBER);
76   printStatus(summary);
78   for (var i=0; i<UBound; i++)
79   {
80     reportCompare(expectedvalues[i], actualvalues[i], statusitems[i]);
81   }