Debian Codegraph @

rhino/testsrc/tests/js1_5/Regress/regress-246964.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 var gTestfile = 'regress-246964.js';
7 //-----------------------------------------------------------------------------
8 var BUGNUMBER = 246964;
9 // see also bug 248549, bug 253150, bug 259935
10 var summary = 'undetectable document.all';
11 var actual = '';
12 var expect = '';
13
14 printBugNumber(BUGNUMBER);
15 printStatus (summary);
16
17 if (typeof document == 'undefined')
18 {
19 expect = actual = 'Test requires browser: skipped';
20 reportCompare(expect, actual, summary);
21 }
22 else
23 {
24 status = summary + ' ' + inSection(1) + ' if (document.all) ';
25 expect = false;
26 actual = false;
27 if (document.all)
28 {
29 actual = true;
30 }
31 reportCompare(expect, actual, status);
32
33 status = summary + ' ' + inSection(2) + 'if (isIE) ';
34 expect = false;
35 actual = false;
36 var isIE = document.all;
37 if (isIE)
38 {
39 actual = true;
40 }
41 reportCompare(expect, actual, status);
42
43 status = summary + ' ' + inSection(3) + ' if (document.all != undefined) ';
44 expect = false;
45 actual = false;
46 if (document.all != undefined)
47 {
48 actual = true;
49 }
50 reportCompare(expect, actual, status);
51
52
53 status = summary + ' ' + inSection(4) + ' if (document.all !== undefined) ';
54 expect = false;
55 actual = false;
56 if (document.all !== undefined)
57 {
58 actual = true;
59 }
60 reportCompare(expect, actual, status);
61
62 status = summary + ' ' + inSection(5) + ' if (document.all != null) ' ;
63 expect = false;
64 actual = false;
65 if (document.all != null)
66 {
67 actual = true;
68 }
69 reportCompare(expect, actual, status);
70
71 status = summary + ' ' + inSection(6) + ' if (document.all !== null) ' ;
72 expect = true;
73 actual = false;
74 if (document.all !== null)
75 {
76 actual = true;
77 }
78 reportCompare(expect, actual, status);
79
80 status = summary + ' ' + inSection(7) + ' if (document.all == null) ';
81 expect = true;
82 actual = false;
83 if (document.all == null)
84 {
85 actual = true;
86 }
87 reportCompare(expect, actual, status);
88
89 status = summary + ' ' + inSection(8) + ' if (document.all === null) ';
90 expect = false;
91 actual = false;
92 if (document.all === null)
93 {
94 actual = true;
95 }
96 reportCompare(expect, actual, status);
97
98 status = summary + ' ' + inSection(9) + ' if (document.all == undefined) ';
99 expect = true;
100 actual = false;
101 if (document.all == undefined)
102 {
103 actual = true;
104 }
105 reportCompare(expect, actual, status);
106
107 status = summary + ' ' + inSection(10) + ' if (document.all === undefined) ';
108 expect = true;
109 actual = false;
110 if (document.all === undefined)
111 {
112 actual = true;
113 }
114 reportCompare(expect, actual, status);
115
116 status = summary + ' ' + inSection(11) +
117 ' if (typeof document.all == "undefined") ';
118 expect = true;
119 actual = false;
120 if (typeof document.all == 'undefined')
121 {
122 actual = true;
123 }
124 reportCompare(expect, actual, status);
125
126 status = summary + ' ' + inSection(12) +
127 ' if (typeof document.all != "undefined") ';
128 expect = false;
129 actual = false;
130 if (typeof document.all != 'undefined')
131 {
132 actual = true;
133 }
134 reportCompare(expect, actual, status);
135
136 status = summary + ' ' + inSection(13) + ' if ("all" in document) ';
137 expect = (document.compatMode == 'CSS1Compat') ? false : true;
138 actual = false;
139 if ('all' in document)
140 {
141 actual = true;
142 }
143 reportCompare(expect, actual, status);
144
145 status = summary + ' ' + inSection(14) + ' if (f.ie) ';
146 var f = new foo();
147
148 expect = false;
149 actual = false;
150 if (f.ie)
151 {
152 actual = true;
153 }
154 reportCompare(expect, actual, status);
155
156 }
157
158 function foo()
159 {
160 this.ie = document.all;
161 }