Debian Codegraph @

js/src/tests/non262/regress/regress-259935.js

raw
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 var BUGNUMBER = 259935;
8 var summary = 'document.all can be easily detected';
9 var actual = '';
10 var expect = 'not detected';
11
12 printBugNumber(BUGNUMBER);
13 printStatus (summary);
14
15 if (typeof document == 'undefined')
16 {
17 document = {};
18 }
19
20 function foo() {
21 this.ie = document.all;
22 }
23
24 var f = new foo();
25
26 if (f.ie) {
27 actual = 'detected';
28 } else {
29 actual = 'not detected';
30 }
31
32 reportCompare(expect, actual, summary);
33
34 f = {ie: document.all};
35
36 if (f.ie) {
37 actual = 'detected';
38 } else {
39 actual = 'not detected';
40 }
41
42 reportCompare(expect, actual, summary);