Wed, 31 Dec 2014 06:09:35 +0100
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: 16 September 2002
9 * SUMMARY: Testing propertyIsEnumerable() on nonexistent property
10 * See http://bugzilla.mozilla.org/show_bug.cgi?id=156354
11 *
12 */
13 //-----------------------------------------------------------------------------
14 var UBound = 0;
15 var BUGNUMBER = 156354;
16 var summary = 'Testing propertyIsEnumerable() on nonexistent property';
17 var status = '';
18 var statusitems = [];
19 var actual = '';
20 var actualvalues = [];
21 var expect= '';
22 var expectedvalues = [];
25 status = inSection(1);
26 actual = this.propertyIsEnumerable('XYZ');
27 expect = false;
28 addThis();
30 status = inSection(2);
31 actual = this.propertyIsEnumerable('');
32 expect = false;
33 addThis();
35 status = inSection(3);
36 actual = this.propertyIsEnumerable(undefined);
37 expect = false;
38 addThis();
40 status = inSection(4);
41 actual = this.propertyIsEnumerable(null);
42 expect = false;
43 addThis();
45 status = inSection(5);
46 actual = this.propertyIsEnumerable('\u02b1');
47 expect = false;
48 addThis();
51 var obj = {prop1:null};
53 status = inSection(6);
54 actual = obj.propertyIsEnumerable('prop1');
55 expect = true;
56 addThis();
58 status = inSection(7);
59 actual = obj.propertyIsEnumerable('prop2');
60 expect = false;
61 addThis();
63 // let's try one via eval(), too -
64 status = inSection(8);
65 eval("actual = obj.propertyIsEnumerable('prop2')");
66 expect = false;
67 addThis();
71 //-----------------------------------------------------------------------------
72 test();
73 //-----------------------------------------------------------------------------
76 function addThis()
77 {
78 statusitems[UBound] = status;
79 actualvalues[UBound] = actual;
80 expectedvalues[UBound] = expect;
81 UBound++;
82 }
85 function test()
86 {
87 enterFunc('test');
88 printBugNumber(BUGNUMBER);
89 printStatus(summary);
91 for (var i=0; i<UBound; i++)
92 {
93 reportCompare(expectedvalues[i], actualvalues[i], statusitems[i]);
94 }
96 exitFunc ('test');
97 }