js/src/tests/ecma_3/Operators/11.4.1-001.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:    14 April 2003
     9  * SUMMARY: |delete x.y| should return |true| if |x| has no property |y|
    10  * See http://bugzilla.mozilla.org/show_bug.cgi?id=201987
    11  *
    12  */
    13 //-----------------------------------------------------------------------------
    14 var UBound = 0;
    15 var BUGNUMBER = 201987;
    16 var summary = '|delete x.y| should return |true| if |x| has no property |y|';
    17 var status = '';
    18 var statusitems = [];
    19 var actual = '';
    20 var actualvalues = [];
    21 var expect= '';
    22 var expectedvalues = [];
    25 status = inSection(1);
    26 var x = {};
    27 actual = delete x.y;
    28 expect = true;
    29 addThis();
    31 status = inSection(2);
    32 actual = delete {}.y;
    33 expect = true;
    34 addThis();
    36 status = inSection(3);
    37 actual = delete "".y;
    38 expect = true;
    39 addThis();
    41 status = inSection(4);
    42 actual = delete /abc/.y;
    43 expect = true;
    44 addThis();
    46 status = inSection(5);
    47 actual = delete (new Date()).y;
    48 expect = true;
    49 addThis();
    51 status = inSection(6);
    52 var x = 99;
    53 actual = delete x.y;
    54 expect = true;
    55 addThis();
    59 //-----------------------------------------------------------------------------
    60 test();
    61 //-----------------------------------------------------------------------------
    65 function addThis()
    66 {
    67   statusitems[UBound] = status;
    68   actualvalues[UBound] = actual;
    69   expectedvalues[UBound] = expect;
    70   UBound++;
    71 }
    74 function test()
    75 {
    76   enterFunc('test');
    77   printBugNumber(BUGNUMBER);
    78   printStatus(summary);
    80   for (var i=0; i<UBound; i++)
    81   {
    82     reportCompare(expectedvalues[i], actualvalues[i], statusitems[i]);
    83   }
    85   exitFunc ('test');
    86 }

mercurial