js/src/tests/ecma_3/Function/regress-137181.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:    12 Apr 2002
     9  * SUMMARY: delete arguments[i] should break connection to local reference
    10  *
    11  * See http://bugzilla.mozilla.org/show_bug.cgi?id=137181
    12  *
    13  */
    14 //-----------------------------------------------------------------------------
    15 var UBound = 0;
    16 var BUGNUMBER = 137181;
    17 var summary = 'delete arguments[i] should break connection to local reference';
    18 var status = '';
    19 var statusitems = [];
    20 var actual = '';
    21 var actualvalues = [];
    22 var expect= '';
    23 var expectedvalues = [];
    26 status = inSection(1);
    27 function f1(x)
    28 {
    29   x = 1;
    30   delete arguments[0];
    31   return x;
    32 }
    33 actual = f1(0); // (bug: Rhino was returning |undefined|)
    34 expect = 1;
    35 addThis();
    38 status = inSection(2);
    39 function f2(x)
    40 {
    41   x = 1;
    42   delete arguments[0];
    43   arguments[0] = -1;
    44   return x;
    45 }
    46 actual = f2(0); // (bug: Rhino was returning -1)
    47 expect = 1;
    48 addThis();
    52 //-----------------------------------------------------------------------------
    53 test();
    54 //-----------------------------------------------------------------------------
    58 function addThis()
    59 {
    60   statusitems[UBound] = status;
    61   actualvalues[UBound] = actual;
    62   expectedvalues[UBound] = expect;
    63   UBound++;
    64 }
    67 function test()
    68 {
    69   enterFunc('test');
    70   printBugNumber(BUGNUMBER);
    71   printStatus(summary);
    73   for (var i=0; i<UBound; i++)
    74   {
    75     reportCompare(expectedvalues[i], actualvalues[i], statusitems[i]);
    76   }
    78   exitFunc ('test');
    79 }

mercurial