Debian Codegraph @

rhino/testsrc/tests/ecma_3/Operators/11.4.1-001.js

raw symbols SCIP
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/. */
5
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 gTestfile = '11.4.1-001.js';
15 var UBound = 0;
16 var BUGNUMBER = 201987;
17 var summary = '|delete x.y| should return |true| if |x| has no property |y|';
18 var status = '';
19 var statusitems = [];
20 var actual = '';
21 var actualvalues = [];
22 var expect= '';
23 var expectedvalues = [];
24
25
26 status = inSection(1);
27 var x = {};
28 actual = delete x.y;
29 expect = true;
30 addThis();
31
32 status = inSection(2);
33 actual = delete {}.y;
34 expect = true;
35 addThis();
36
37 status = inSection(3);
38 actual = delete "".y;
39 expect = true;
40 addThis();
41
42 status = inSection(4);
43 actual = delete /abc/.y;
44 expect = true;
45 addThis();
46
47 status = inSection(5);
48 actual = delete (new Date()).y;
49 expect = true;
50 addThis();
51
52 status = inSection(6);
53 var x = 99;
54 actual = delete x.y;
55 expect = true;
56 addThis();
57
58
59
60 //-----------------------------------------------------------------------------
61 test();
62 //-----------------------------------------------------------------------------
63
64
65
66 function addThis()
67 {
68 statusitems[UBound] = status;
69 actualvalues[UBound] = actual;
70 expectedvalues[UBound] = expect;
71 UBound++;
72 }
73
74
75 function test()
76 {
77 enterFunc('test');
78 printBugNumber(BUGNUMBER);
79 printStatus(summary);
80
81 for (var i=0; i<UBound; i++)
82 {
83 reportCompare(expectedvalues[i], actualvalues[i], statusitems[i]);
84 }
85
86 exitFunc ('test');
87 }