|
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 = 253150; |
|
8 var summary = 'Do not warn on detecting properties'; |
|
9 var actual = ''; |
|
10 var expect = 'No warning'; |
|
11 |
|
12 printBugNumber(BUGNUMBER); |
|
13 printStatus (summary); |
|
14 |
|
15 var testobject = {}; |
|
16 |
|
17 options('strict'); |
|
18 options('werror'); |
|
19 |
|
20 try |
|
21 { |
|
22 var testresult = testobject.foo; |
|
23 actual = 'No warning'; |
|
24 } |
|
25 catch(ex) |
|
26 { |
|
27 actual = ex + ''; |
|
28 } |
|
29 |
|
30 reportCompare(expect, actual, summary + ': 1'); |
|
31 |
|
32 try |
|
33 { |
|
34 if (testobject.foo) |
|
35 { |
|
36 ; |
|
37 } |
|
38 actual = 'No warning'; |
|
39 } |
|
40 catch(ex) |
|
41 { |
|
42 actual = ex + ''; |
|
43 } |
|
44 |
|
45 reportCompare(expect, actual, summary + ': 2'); |
|
46 |
|
47 try |
|
48 { |
|
49 if (typeof testobject.foo == 'undefined') |
|
50 { |
|
51 ; |
|
52 } |
|
53 actual = 'No warning'; |
|
54 } |
|
55 catch(ex) |
|
56 { |
|
57 actual = ex + ''; |
|
58 } |
|
59 |
|
60 reportCompare(expect, actual, summary + ': 3'); |
|
61 |
|
62 try |
|
63 { |
|
64 if (testobject.foo == null) |
|
65 { |
|
66 ; |
|
67 } |
|
68 actual = 'No warning'; |
|
69 } |
|
70 catch(ex) |
|
71 { |
|
72 actual = ex + ''; |
|
73 } |
|
74 |
|
75 reportCompare(expect, actual, summary + ': 4'); |
|
76 |
|
77 try |
|
78 { |
|
79 if (testobject.foo == undefined) |
|
80 { |
|
81 ; |
|
82 } |
|
83 actual = 'No warning'; |
|
84 } |
|
85 catch(ex) |
|
86 { |
|
87 actual = ex + ''; |
|
88 } |
|
89 |
|
90 reportCompare(expect, actual, summary + ': 3'); |