1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 1.2 +++ b/js/src/tests/ecma_3/Operators/11.4.1-001.js Wed Dec 31 06:09:35 2014 +0100 1.3 @@ -0,0 +1,86 @@ 1.4 +/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ 1.5 +/* This Source Code Form is subject to the terms of the Mozilla Public 1.6 + * License, v. 2.0. If a copy of the MPL was not distributed with this 1.7 + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ 1.8 + 1.9 +/* 1.10 + * 1.11 + * Date: 14 April 2003 1.12 + * SUMMARY: |delete x.y| should return |true| if |x| has no property |y| 1.13 + * See http://bugzilla.mozilla.org/show_bug.cgi?id=201987 1.14 + * 1.15 + */ 1.16 +//----------------------------------------------------------------------------- 1.17 +var UBound = 0; 1.18 +var BUGNUMBER = 201987; 1.19 +var summary = '|delete x.y| should return |true| if |x| has no property |y|'; 1.20 +var status = ''; 1.21 +var statusitems = []; 1.22 +var actual = ''; 1.23 +var actualvalues = []; 1.24 +var expect= ''; 1.25 +var expectedvalues = []; 1.26 + 1.27 + 1.28 +status = inSection(1); 1.29 +var x = {}; 1.30 +actual = delete x.y; 1.31 +expect = true; 1.32 +addThis(); 1.33 + 1.34 +status = inSection(2); 1.35 +actual = delete {}.y; 1.36 +expect = true; 1.37 +addThis(); 1.38 + 1.39 +status = inSection(3); 1.40 +actual = delete "".y; 1.41 +expect = true; 1.42 +addThis(); 1.43 + 1.44 +status = inSection(4); 1.45 +actual = delete /abc/.y; 1.46 +expect = true; 1.47 +addThis(); 1.48 + 1.49 +status = inSection(5); 1.50 +actual = delete (new Date()).y; 1.51 +expect = true; 1.52 +addThis(); 1.53 + 1.54 +status = inSection(6); 1.55 +var x = 99; 1.56 +actual = delete x.y; 1.57 +expect = true; 1.58 +addThis(); 1.59 + 1.60 + 1.61 + 1.62 +//----------------------------------------------------------------------------- 1.63 +test(); 1.64 +//----------------------------------------------------------------------------- 1.65 + 1.66 + 1.67 + 1.68 +function addThis() 1.69 +{ 1.70 + statusitems[UBound] = status; 1.71 + actualvalues[UBound] = actual; 1.72 + expectedvalues[UBound] = expect; 1.73 + UBound++; 1.74 +} 1.75 + 1.76 + 1.77 +function test() 1.78 +{ 1.79 + enterFunc('test'); 1.80 + printBugNumber(BUGNUMBER); 1.81 + printStatus(summary); 1.82 + 1.83 + for (var i=0; i<UBound; i++) 1.84 + { 1.85 + reportCompare(expectedvalues[i], actualvalues[i], statusitems[i]); 1.86 + } 1.87 + 1.88 + exitFunc ('test'); 1.89 +}