OLD | NEW |
| (Empty) |
1 // Copyright 2015 the V8 project authors. All rights reserved. | |
2 // Use of this source code is governed by a BSD-style license that can be | |
3 // found in the LICENSE file. | |
4 | |
5 // Flags: --strong-mode --allow-natives-syntax | |
6 | |
7 "use strict"; | |
8 | |
9 function getTestFuncs() { | |
10 "use strong"; | |
11 return [ | |
12 function(x){return 1 + true;}, | |
13 function(x){return 1 - true;}, | |
14 function(x){return 1 * true;}, | |
15 function(x){return 1 / true;}, | |
16 function(x){return 1 % true;}, | |
17 function(x){return 1 | true;}, | |
18 function(x){return 1 & true;}, | |
19 function(x){return 1 ^ true;}, | |
20 function(x){return 1 << true;}, | |
21 function(x){return 1 >> true;}, | |
22 function(x){return 1 >>> true;}, | |
23 function(x){return 1 < true;}, | |
24 function(x){return 1 > true;}, | |
25 function(x){return 1 <= true;}, | |
26 function(x){return 1 >= true;}, | |
27 function(x){return 1 + undefined;}, | |
28 function(x){return 1 - undefined;}, | |
29 function(x){return 1 * undefined;}, | |
30 function(x){return 1 / undefined;}, | |
31 function(x){return 1 % undefined;}, | |
32 function(x){return 1 | undefined;}, | |
33 function(x){return 1 & undefined;}, | |
34 function(x){return 1 ^ undefined;}, | |
35 function(x){return 1 << undefined;}, | |
36 function(x){return 1 >> undefined;}, | |
37 function(x){return 1 >>> undefined;}, | |
38 function(x){return 1 < undefined;}, | |
39 function(x){return 1 > undefined;}, | |
40 function(x){return 1 <= undefined;}, | |
41 function(x){return 1 >= undefined;}, | |
42 function(x){return 1 + null;}, | |
43 function(x){return 1 - null;}, | |
44 function(x){return 1 * null;}, | |
45 function(x){return 1 / null;}, | |
46 function(x){return 1 % null;}, | |
47 function(x){return 1 | null;}, | |
48 function(x){return 1 & null;}, | |
49 function(x){return 1 ^ null;}, | |
50 function(x){return 1 << null;}, | |
51 function(x){return 1 >> null;}, | |
52 function(x){return 1 >>> null;}, | |
53 function(x){return 1 < null;}, | |
54 function(x){return 1 > null;}, | |
55 function(x){return 1 <= null;}, | |
56 function(x){return 1 >= null;}, | |
57 function(x){return NaN + true;}, | |
58 function(x){return NaN - true;}, | |
59 function(x){return NaN * true;}, | |
60 function(x){return NaN / true;}, | |
61 function(x){return NaN % true;}, | |
62 function(x){return NaN | true;}, | |
63 function(x){return NaN & true;}, | |
64 function(x){return NaN ^ true;}, | |
65 function(x){return NaN << true;}, | |
66 function(x){return NaN >> true;}, | |
67 function(x){return NaN >>> true;}, | |
68 function(x){return NaN < true;}, | |
69 function(x){return NaN > true;}, | |
70 function(x){return NaN <= true;}, | |
71 function(x){return NaN >= true;}, | |
72 function(x){return NaN + undefined;}, | |
73 function(x){return NaN - undefined;}, | |
74 function(x){return NaN * undefined;}, | |
75 function(x){return NaN / undefined;}, | |
76 function(x){return NaN % undefined;}, | |
77 function(x){return NaN | undefined;}, | |
78 function(x){return NaN & undefined;}, | |
79 function(x){return NaN ^ undefined;}, | |
80 function(x){return NaN << undefined;}, | |
81 function(x){return NaN >> undefined;}, | |
82 function(x){return NaN >>> undefined;}, | |
83 function(x){return NaN < undefined;}, | |
84 function(x){return NaN > undefined;}, | |
85 function(x){return NaN <= undefined;}, | |
86 function(x){return NaN >= undefined;}, | |
87 function(x){return NaN + null;}, | |
88 function(x){return NaN - null;}, | |
89 function(x){return NaN * null;}, | |
90 function(x){return NaN / null;}, | |
91 function(x){return NaN % null;}, | |
92 function(x){return NaN | null;}, | |
93 function(x){return NaN & null;}, | |
94 function(x){return NaN ^ null;}, | |
95 function(x){return NaN << null;}, | |
96 function(x){return NaN >> null;}, | |
97 function(x){return NaN >>> null;}, | |
98 function(x){return NaN < null;}, | |
99 function(x){return NaN > null;}, | |
100 function(x){return NaN <= null;}, | |
101 function(x){return NaN >= null;}, | |
102 function(x){return true + 1;}, | |
103 function(x){return true - 1;}, | |
104 function(x){return true * 1;}, | |
105 function(x){return true / 1;}, | |
106 function(x){return true % 1;}, | |
107 function(x){return true | 1;}, | |
108 function(x){return true & 1;}, | |
109 function(x){return true ^ 1;}, | |
110 function(x){return true << 1;}, | |
111 function(x){return true >> 1;}, | |
112 function(x){return true >>> 1;}, | |
113 function(x){return true < 1;}, | |
114 function(x){return true > 1;}, | |
115 function(x){return true <= 1;}, | |
116 function(x){return true >= 1;}, | |
117 function(x){return undefined + 1;}, | |
118 function(x){return undefined - 1;}, | |
119 function(x){return undefined * 1;}, | |
120 function(x){return undefined / 1;}, | |
121 function(x){return undefined % 1;}, | |
122 function(x){return undefined | 1;}, | |
123 function(x){return undefined & 1;}, | |
124 function(x){return undefined ^ 1;}, | |
125 function(x){return undefined << 1;}, | |
126 function(x){return undefined >> 1;}, | |
127 function(x){return undefined >>> 1;}, | |
128 function(x){return undefined < 1;}, | |
129 function(x){return undefined > 1;}, | |
130 function(x){return undefined <= 1;}, | |
131 function(x){return undefined >= 1;}, | |
132 function(x){return null + 1;}, | |
133 function(x){return null - 1;}, | |
134 function(x){return null * 1;}, | |
135 function(x){return null / 1;}, | |
136 function(x){return null % 1;}, | |
137 function(x){return null | 1;}, | |
138 function(x){return null & 1;}, | |
139 function(x){return null ^ 1;}, | |
140 function(x){return null << 1;}, | |
141 function(x){return null >> 1;}, | |
142 function(x){return null >>> 1;}, | |
143 function(x){return null < 1;}, | |
144 function(x){return null > 1;}, | |
145 function(x){return null <= 1;}, | |
146 function(x){return null >= 1;}, | |
147 function(x){return true + NaN;}, | |
148 function(x){return true - NaN;}, | |
149 function(x){return true * NaN;}, | |
150 function(x){return true / NaN;}, | |
151 function(x){return true % NaN;}, | |
152 function(x){return true | NaN;}, | |
153 function(x){return true & NaN;}, | |
154 function(x){return true ^ NaN;}, | |
155 function(x){return true << NaN;}, | |
156 function(x){return true >> NaN;}, | |
157 function(x){return true >>> NaN;}, | |
158 function(x){return true < NaN;}, | |
159 function(x){return true > NaN;}, | |
160 function(x){return true <= NaN;}, | |
161 function(x){return true >= NaN;}, | |
162 function(x){return undefined + NaN;}, | |
163 function(x){return undefined - NaN;}, | |
164 function(x){return undefined * NaN;}, | |
165 function(x){return undefined / NaN;}, | |
166 function(x){return undefined % NaN;}, | |
167 function(x){return undefined | NaN;}, | |
168 function(x){return undefined & NaN;}, | |
169 function(x){return undefined ^ NaN;}, | |
170 function(x){return undefined << NaN;}, | |
171 function(x){return undefined >> NaN;}, | |
172 function(x){return undefined >>> NaN;}, | |
173 function(x){return undefined < NaN;}, | |
174 function(x){return undefined > NaN;}, | |
175 function(x){return undefined <= NaN;}, | |
176 function(x){return undefined >= NaN;}, | |
177 function(x){return null + NaN;}, | |
178 function(x){return null - NaN;}, | |
179 function(x){return null * NaN;}, | |
180 function(x){return null / NaN;}, | |
181 function(x){return null % NaN;}, | |
182 function(x){return null | NaN;}, | |
183 function(x){return null & NaN;}, | |
184 function(x){return null ^ NaN;}, | |
185 function(x){return null << NaN;}, | |
186 function(x){return null >> NaN;}, | |
187 function(x){return null >>> NaN;}, | |
188 function(x){return null < NaN;}, | |
189 function(x){return null > NaN;}, | |
190 function(x){return null <= NaN;}, | |
191 function(x){return null >= NaN;} | |
192 ]; | |
193 } | |
194 | |
195 for (let func of getTestFuncs()) { | |
196 assertThrows(func, TypeError); | |
197 assertThrows(func, TypeError); | |
198 assertThrows(func, TypeError); | |
199 %OptimizeFunctionOnNextCall(func); | |
200 assertThrows(func, TypeError); | |
201 %DeoptimizeFunction(func); | |
202 assertThrows(func, TypeError); | |
203 } | |
OLD | NEW |