js/src/tests/js1_5/Expressions/regress-192288.js

Wed, 31 Dec 2014 06:09:35 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Wed, 31 Dec 2014 06:09:35 +0100
changeset 0
6474c204b198
permissions
-rw-r--r--

Cloned upstream origin tor-browser at tor-browser-31.3.0esr-4.5-1-build1
revision ID fc1c9ff7c1b2defdbc039f12214767608f46423f for hacking purpose.

     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/. */
     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()
    27 {
    28   return 0/0;
    29 }
    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()
    65 {
    66   statusitems[UBound] = status;
    67   actualvalues[UBound] = actual;
    68   expectedvalues[UBound] = expect;
    69   UBound++;
    70 }
    73 function test()
    74 {
    75   enterFunc('test');
    76   printBugNumber(BUGNUMBER);
    77   printStatus(summary);
    79   for (var i=0; i<UBound; i++)
    80   {
    81     reportCompare(expectedvalues[i], actualvalues[i], statusitems[i]);
    82   }
    84   exitFunc ('test');
    85 }

mercurial