push ac694015ba9a1d7cf8fc6346c6e51d4c35a62962
[wine/hacks.git] / dlls / jscript / tests / api.js
blobad4822c580e666c834bee8e95c1c2c5a96b9345e
1 /*
2  * Copyright 2008 Jacek Caban for CodeWeavers
3  *
4  * This library is free software; you can redistribute it and/or
5  * modify it under the terms of the GNU Lesser General Public
6  * License as published by the Free Software Foundation; either
7  * version 2.1 of the License, or (at your option) any later version.
8  *
9  * This library is distributed in the hope that it will be useful,
10  * but WITHOUT ANY WARRANTY; without even the implied warranty of
11  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
12  * Lesser General Public License for more details.
13  *
14  * You should have received a copy of the GNU Lesser General Public
15  * License along with this library; if not, write to the Free Software
16  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
17  */
19 var tmp, i;
21 i = parseInt("0");
22 ok(i === 0, "parseInt('0') = " + i);
23 i = parseInt("123");
24 ok(i === 123, "parseInt('123') = " + i);
25 i = parseInt("-123");
26 ok(i === -123, "parseInt('-123') = " + i);
27 i = parseInt("0xff");
28 ok(i === 0xff, "parseInt('0xff') = " + i);
29 i = parseInt("11", 8);
30 ok(i === 9, "parseInt('11', 8) = " + i);
31 i = parseInt("1j", 22);
32 ok(i === 41, "parseInt('1j', 32) = " + i);
33 i = parseInt("123", 0);
34 ok(i === 123, "parseInt('123', 0) = " + i);
35 i = parseInt("123", 10, "test");
36 ok(i === 123, "parseInt('123', 10, 'test') = " + i);
37 i = parseInt("11", "8");
38 ok(i === 9, "parseInt('11', '8') = " + i);
40 tmp = encodeURI("abc");
41 ok(tmp === "abc", "encodeURI('abc') = " + tmp);
42 tmp = encodeURI("{abc}");
43 ok(tmp === "%7Babc%7D", "encodeURI('{abc}') = " + tmp);
44 tmp = encodeURI("");
45 ok(tmp === "", "encodeURI('') = " + tmp);
46 tmp = encodeURI("\01\02\03\04");
47 ok(tmp === "%01%02%03%04", "encodeURI('\\01\\02\\03\\04') = " + tmp);
48 tmp = encodeURI("{#@}");
49 ok(tmp === "%7B#@%7D", "encodeURI('{#@}') = " + tmp);
50 tmp = encodeURI("\xa1 ");
51 ok(tmp === "%C2%A1%20", "encodeURI(\\xa1 ) = " + tmp);
52 tmp = encodeURI("\xffff");
53 ok(tmp.length === 8, "encodeURI('\\xffff').length = " + tmp.length);
54 tmp = encodeURI("abcABC123;/?:@&=+$,-_.!~*'()");
55 ok(tmp === "abcABC123;/?:@&=+$,-_.!~*'()", "encodeURI('abcABC123;/?:@&=+$,-_.!~*'()') = " + tmp);
56 tmp = encodeURI();
57 ok(tmp === "undefined", "encodeURI() = " + tmp);
58 tmp = encodeURI("abc", "test");
59 ok(tmp === "abc", "encodeURI('abc') = " + tmp);
61 tmp = "" + new Object();
62 ok(tmp === "[object Object]", "'' + new Object() = " + tmp);
64 ok("".length === 0, "\"\".length = " + "".length);
65 ok(getVT("".length) == "VT_I4", "\"\".length = " + "".length);
66 ok("abc".length === 3, "\"abc\".length = " + "abc".length);
67 ok(String.prototype.length === 0, "String.prototype.length = " + String.prototype.length);
69 tmp = "".toString();
70 ok(tmp === "", "''.toString() = " + tmp);
71 tmp = "test".toString();
72 ok(tmp === "test", "''.toString() = " + tmp);
73 tmp = "test".toString(3);
74 ok(tmp === "test", "''.toString(3) = " + tmp);
76 tmp = "".valueOf();
77 ok(tmp === "", "''.valueOf() = " + tmp);
78 tmp = "test".valueOf();
79 ok(tmp === "test", "''.valueOf() = " + tmp);
80 tmp = "test".valueOf(3);
81 ok(tmp === "test", "''.valueOf(3) = " + tmp);
83 var str = new String("test");
84 ok(str.toString() === "test", "str.toString() = " + str.toString());
85 var str = new String();
86 ok(str.toString() === "", "str.toString() = " + str.toString());
87 var str = new String("test", "abc");
88 ok(str.toString() === "test", "str.toString() = " + str.toString());
90 tmp = "value " + str;
91 ok(tmp === "value test", "'value ' + str = " + tmp);
93 tmp = String();
94 ok(tmp === "", "String() = " + tmp);
95 tmp = String(false);
96 ok(tmp === "false", "String(false) = " + tmp);
97 tmp = String(null);
98 ok(tmp === "null", "String(null) = " + tmp);
99 tmp = String("test");
100 ok(tmp === "test", "String('test') = " + tmp);
101 tmp = String("test", "abc");
102 ok(tmp === "test", "String('test','abc') = " + tmp);
104 tmp = "abc".charAt(0);
105 ok(tmp === "a", "'abc',charAt(0) = " + tmp);
106 tmp = "abc".charAt(1);
107 ok(tmp === "b", "'abc',charAt(1) = " + tmp);
108 tmp = "abc".charAt(2);
109 ok(tmp === "c", "'abc',charAt(2) = " + tmp);
110 tmp = "abc".charAt(3);
111 ok(tmp === "", "'abc',charAt(3) = " + tmp);
112 tmp = "abc".charAt(4);
113 ok(tmp === "", "'abc',charAt(4) = " + tmp);
114 tmp = "abc".charAt();
115 ok(tmp === "a", "'abc',charAt() = " + tmp);
116 tmp = "abc".charAt(-1);
117 ok(tmp === "", "'abc',charAt(-1) = " + tmp);
118 tmp = "abc".charAt(0,2);
119 ok(tmp === "a", "'abc',charAt(0.2) = " + tmp);
121 tmp = "abc".charCodeAt(0);
122 ok(tmp === 0x61, "'abc'.charCodeAt(0) = " + tmp);
123 tmp = "abc".charCodeAt(1);
124 ok(tmp === 0x62, "'abc'.charCodeAt(1) = " + tmp);
125 tmp = "abc".charCodeAt(2);
126 ok(tmp === 0x63, "'abc'.charCodeAt(2) = " + tmp);
127 tmp = "abc".charCodeAt();
128 ok(tmp === 0x61, "'abc'.charCodeAt() = " + tmp);
129 tmp = "abc".charCodeAt(true);
130 ok(tmp === 0x62, "'abc'.charCodeAt(true) = " + tmp);
131 tmp = "abc".charCodeAt(0,2);
132 ok(tmp === 0x61, "'abc'.charCodeAt(0,2) = " + tmp);
134 tmp = "abcd".substring(1,3);
135 ok(tmp === "bc", "'abcd'.substring(1,3) = " + tmp);
136 tmp = "abcd".substring(-1,3);
137 ok(tmp === "abc", "'abcd'.substring(-1,3) = " + tmp);
138 tmp = "abcd".substring(1,6);
139 ok(tmp === "bcd", "'abcd'.substring(1,6) = " + tmp);
140 tmp = "abcd".substring(3,1);
141 ok(tmp === "bc", "'abcd'.substring(3,1) = " + tmp);
142 tmp = "abcd".substring(2,2);
143 ok(tmp === "", "'abcd'.substring(2,2) = " + tmp);
144 tmp = "abcd".substring(true,"3");
145 ok(tmp === "bc", "'abcd'.substring(true,'3') = " + tmp);
146 tmp = "abcd".substring(1,3,2);
147 ok(tmp === "bc", "'abcd'.substring(1,3,2) = " + tmp);
148 tmp = "abcd".substring();
149 ok(tmp === "abcd", "'abcd'.substring() = " + tmp);
151 tmp = "abcd".slice(1,3);
152 ok(tmp === "bc", "'abcd'.slice(1,3) = " + tmp);
153 tmp = "abcd".slice(1,-1);
154 ok(tmp === "bc", "'abcd'.slice(1,-1) = " + tmp);
155 tmp = "abcd".slice(-3,3);
156 ok(tmp === "bc", "'abcd'.slice(-3,3) = " + tmp);
157 tmp = "abcd".slice(-6,3);
158 ok(tmp === "abc", "'abcd'.slice(-6,3) = " + tmp);
159 tmp = "abcd".slice(3,1);
160 ok(tmp === "", "'abcd'.slice(3,1) = " + tmp);
161 tmp = "abcd".slice(true,3);
162 ok(tmp === "bc", "'abcd'.slice(true,3) = " + tmp);
163 tmp = "abcd".slice();
164 ok(tmp === "abcd", "'abcd'.slice() = " + tmp);
165 tmp = "abcd".slice(1);
166 ok(tmp === "bcd", "'abcd'.slice(1) = " + tmp);
168 tmp = "abc".concat(["d",1],2,false);
169 ok(tmp === "abcd,12false", "concat returned " + tmp);
170 var arr = new Array(2,"a");
171 arr.concat = String.prototype.concat;
172 tmp = arr.concat("d");
173 ok(tmp === "2,ad", "arr.concat = " + tmp);
175 m = "a+bcabc".match("a+");
176 ok(typeof(m) === "object", "typeof m is not object");
177 ok(m.length === 1, "m.length is not 1");
178 ok(m["0"] === "a", "m[0] is not \"ab\"");
180 r = "- [test] -".replace("[test]", "success");
181 ok(r === "- success -", "r = " + r + " expected '- success -'");
183 r = "- [test] -".replace("[test]", "success", "test");
184 ok(r === "- success -", "r = " + r + " expected '- success -'");
186 r = "test".replace();
187 ok(r === "test", "r = " + r + " expected 'test'");
189 function replaceFunc3(m, off, str) {
190     ok(arguments.length === 3, "arguments.length = " + arguments.length);
191     ok(m === "[test]", "m = " + m + " expected [test1]");
192     ok(off === 1, "off = " + off + " expected 0");
193     ok(str === "-[test]-", "str = " + arguments[3]);
194     return "ret";
197 r = "-[test]-".replace("[test]", replaceFunc3);
198 ok(r === "-ret-", "r = " + r + " expected '-ret-'");
200 r = "-[test]-".replace("[test]", replaceFunc3, "test");
201 ok(r === "-ret-", "r = " + r + " expected '-ret-'");
203 r = "1,2,3".split(",");
204 ok(typeof(r) === "object", "typeof(r) = " + typeof(r));
205 ok(r.length === 3, "r.length = " + r.length);
206 ok(r[0] === "1", "r[0] = " + r[0]);
207 ok(r[1] === "2", "r[1] = " + r[1]);
208 ok(r[2] === "3", "r[2] = " + r[2]);
211 r = "1,2,3".split(",*");
212 ok(r.length === 1, "r.length = " + r.length);
213 ok(r[0] === "1,2,3", "r[0] = " + r[0]);
215 r = "123".split("");
216 ok(r.length === 3, "r.length = " + r.length);
217 ok(r[0] === "1", "r[0] = " + r[0]);
218 ok(r[1] === "2", "r[1] = " + r[1]);
219 ok(r[2] === "3", "r[2] = " + r[2]);
221 r = "123".split(2);
222 ok(r.length === 2, "r.length = " + r.length);
223 ok(r[0] === "1", "r[0] = " + r[0]);
224 ok(r[1] === "3", "r[1] = " + r[1]);
226 r = "1,2,".split(",");
227 ok(typeof(r) === "object", "typeof(r) = " + typeof(r));
228 ok(r.length === 3, "r.length = " + r.length);
229 ok(r[0] === "1", "r[0] = " + r[0]);
230 ok(r[1] === "2", "r[1] = " + r[1]);
231 ok(r[2] === "", "r[2] = " + r[2]);
233 tmp = "abcd".indexOf("bc",0);
234 ok(tmp === 1, "indexOf = " + tmp);
235 tmp = "abcd".indexOf("bc",1);
236 ok(tmp === 1, "indexOf = " + tmp);
237 tmp = "abcd".indexOf("bc");
238 ok(tmp === 1, "indexOf = " + tmp);
239 tmp = "abcd".indexOf("ac");
240 ok(tmp === -1, "indexOf = " + tmp);
241 tmp = "abcd".indexOf("bc",2);
242 ok(tmp === -1, "indexOf = " + tmp);
243 tmp = "abcd".indexOf("a",0);
244 ok(tmp === 0, "indexOf = " + tmp);
245 tmp = "abcd".indexOf("bc",0,"test");
246 ok(tmp === 1, "indexOf = " + tmp);
247 tmp = "abcd".indexOf();
248 ok(tmp == -1, "indexOf = " + tmp);
250 tmp = "".toLowerCase();
251 ok(tmp === "", "''.toLowerCase() = " + tmp);
252 tmp = "test".toLowerCase();
253 ok(tmp === "test", "''.toLowerCase() = " + tmp);
254 tmp = "test".toLowerCase(3);
255 ok(tmp === "test", "''.toLowerCase(3) = " + tmp);
256 tmp = "tEsT".toLowerCase();
257 ok(tmp === "test", "''.toLowerCase() = " + tmp);
258 tmp = "tEsT".toLowerCase(3);
259 ok(tmp === "test", "''.toLowerCase(3) = " + tmp);
261 tmp = "".toUpperCase();
262 ok(tmp === "", "''.toUpperCase() = " + tmp);
263 tmp = "TEST".toUpperCase();
264 ok(tmp === "TEST", "''.toUpperCase() = " + tmp);
265 tmp = "TEST".toUpperCase(3);
266 ok(tmp === "TEST", "''.toUpperCase(3) = " + tmp);
267 tmp = "tEsT".toUpperCase();
268 ok(tmp === "TEST", "''.toUpperCase() = " + tmp);
269 tmp = "tEsT".toUpperCase(3);
270 ok(tmp === "TEST", "''.toUpperCase(3) = " + tmp);
272 tmp = "".big();
273 ok(tmp === "<BIG></BIG>", "''.big() = " + tmp);
274 tmp = "".big(3);
275 ok(tmp === "<BIG></BIG>", "''.big(3) = " + tmp);
276 tmp = "test".big();
277 ok(tmp === "<BIG>test</BIG>", "'test'.big() = " + tmp);
278 tmp = "test".big(3);
279 ok(tmp === "<BIG>test</BIG>", "'test'.big(3) = " + tmp);
281 tmp = "".blink();
282 ok(tmp === "<BLINK></BLINK>", "''.blink() = " + tmp);
283 tmp = "".blink(3);
284 ok(tmp === "<BLINK></BLINK>", "''.blink(3) = " + tmp);
285 tmp = "test".blink();
286 ok(tmp === "<BLINK>test</BLINK>", "'test'.blink() = " + tmp);
287 tmp = "test".blink(3);
288 ok(tmp === "<BLINK>test</BLINK>", "'test'.blink(3) = " + tmp);
290 tmp = "".bold();
291 ok(tmp === "<B></B>", "''.bold() = " + tmp);
292 tmp = "".bold(3);
293 ok(tmp === "<B></B>", "''.bold(3) = " + tmp);
294 tmp = "test".bold();
295 ok(tmp === "<B>test</B>", "'test'.bold() = " + tmp);
296 tmp = "test".bold(3);
297 ok(tmp === "<B>test</B>", "'test'.bold(3) = " + tmp);
299 tmp = "".fixed();
300 ok(tmp === "<TT></TT>", "''.fixed() = " + tmp);
301 tmp = "".fixed(3);
302 ok(tmp === "<TT></TT>", "''.fixed(3) = " + tmp);
303 tmp = "test".fixed();
304 ok(tmp === "<TT>test</TT>", "'test'.fixed() = " + tmp);
305 tmp = "test".fixed(3);
306 ok(tmp === "<TT>test</TT>", "'test'.fixed(3) = " + tmp);
308 tmp = "".italics();
309 ok(tmp === "<I></I>", "''.italics() = " + tmp);
310 tmp = "".italics(3);
311 ok(tmp === "<I></I>", "''.italics(3) = " + tmp);
312 tmp = "test".italics();
313 ok(tmp === "<I>test</I>", "'test'.italics() = " + tmp);
314 tmp = "test".italics(3);
315 ok(tmp === "<I>test</I>", "'test'.italics(3) = " + tmp);
317 tmp = "".small();
318 ok(tmp === "<SMALL></SMALL>", "''.small() = " + tmp);
319 tmp = "".small(3);
320 ok(tmp === "<SMALL></SMALL>", "''.small(3) = " + tmp);
321 tmp = "test".small();
322 ok(tmp === "<SMALL>test</SMALL>", "'test'.small() = " + tmp);
323 tmp = "test".small(3);
324 ok(tmp === "<SMALL>test</SMALL>", "'test'.small(3) = " + tmp);
326 tmp = "".strike();
327 ok(tmp === "<STRIKE></STRIKE>", "''.strike() = " + tmp);
328 tmp = "".strike(3);
329 ok(tmp === "<STRIKE></STRIKE>", "''.strike(3) = " + tmp);
330 tmp = "test".strike();
331 ok(tmp === "<STRIKE>test</STRIKE>", "'test'.strike() = " + tmp);
332 tmp = "test".strike(3);
333 ok(tmp === "<STRIKE>test</STRIKE>", "'test'.strike(3) = " + tmp);
335 tmp = "".sub();
336 ok(tmp === "<SUB></SUB>", "''.sub() = " + tmp);
337 tmp = "".sub(3);
338 ok(tmp === "<SUB></SUB>", "''.sub(3) = " + tmp);
339 tmp = "test".sub();
340 ok(tmp === "<SUB>test</SUB>", "'test'.sub() = " + tmp);
341 tmp = "test".sub(3);
342 ok(tmp === "<SUB>test</SUB>", "'test'.sub(3) = " + tmp);
344 tmp = "".sup();
345 ok(tmp === "<SUP></SUP>", "''.sup() = " + tmp);
346 tmp = "".sup(3);
347 ok(tmp === "<SUP></SUP>", "''.sup(3) = " + tmp);
348 tmp = "test".sup();
349 ok(tmp === "<SUP>test</SUP>", "'test'.sup() = " + tmp);
350 tmp = "test".sup(3);
351 ok(tmp === "<SUP>test</SUP>", "'test'.sup(3) = " + tmp);
353 var arr = new Array();
354 ok(typeof(arr) === "object", "arr () is not object");
355 ok((arr.length === 0), "arr.length is not 0");
356 ok(arr["0"] === undefined, "arr[0] is not undefined");
358 var arr = new Array(1, 2, "test");
359 ok(typeof(arr) === "object", "arr (1,2,test) is not object");
360 ok((arr.length === 3), "arr.length is not 3");
361 ok(arr["0"] === 1, "arr[0] is not 1");
362 ok(arr["1"] === 2, "arr[1] is not 2");
363 ok(arr["2"] === "test", "arr[2] is not \"test\"");
365 arr["7"] = true;
366 ok((arr.length === 8), "arr.length is not 8");
368 tmp = "" + [];
369 ok(tmp === "", "'' + [] = " + tmp);
370 tmp = "" + [1,true];
371 ok(tmp === "1,true", "'' + [1,true] = " + tmp);
373 var arr = new Array(6);
374 ok(typeof(arr) === "object", "arr (6) is not object");
375 ok((arr.length === 6), "arr.length is not 6");
376 ok(arr["0"] === undefined, "arr[0] is not undefined");
378 ok(arr.push() === 6, "arr.push() !== 6");
379 ok(arr.push(1) === 7, "arr.push(1) !== 7");
380 ok(arr[6] === 1, "arr[6] != 1");
381 ok(arr.length === 7, "arr.length != 10");
382 ok(arr.push(true, 'b', false) === 10, "arr.push(true, 'b', false) !== 10");
383 ok(arr[8] === "b", "arr[8] != 'b'");
384 ok(arr.length === 10, "arr.length != 10");
386 arr = [3,4,5];
387 tmp = arr.pop();
388 ok(arr.length === 2, "arr.length = " + arr.length);
389 ok(tmp === 5, "pop() = " + tmp);
390 tmp = arr.pop(2);
391 ok(arr.length === 1, "arr.length = " + arr.length);
392 ok(tmp === 4, "pop() = " + tmp);
393 tmp = arr.pop();
394 ok(arr.length === 0, "arr.length = " + arr.length);
395 ok(tmp === 3, "pop() = " + tmp);
396 for(tmp in arr)
397     ok(false, "not deleted " + tmp);
398 tmp = arr.pop();
399 ok(arr.length === 0, "arr.length = " + arr.length);
400 ok(tmp === undefined, "tmp = " + tmp);
401 arr = [,,,,,];
402 tmp = arr.pop();
403 ok(arr.length === 5, "arr.length = " + arr.length);
404 ok(tmp === undefined, "tmp = " + tmp);
406 arr = [1,2,null,false,undefined,,"a"];
408 tmp = arr.join();
409 ok(tmp === "1,2,,false,,,a", "arr.join() = " + tmp);
410 tmp = arr.join(";");
411 ok(tmp === "1;2;;false;;;a", "arr.join(';') = " + tmp);
412 tmp = arr.join(";","test");
413 ok(tmp === "1;2;;false;;;a", "arr.join(';') = " + tmp);
414 tmp = arr.join("");
415 ok(tmp === "12falsea", "arr.join('') = " + tmp);
417 tmp = arr.toString();
418 ok(tmp === "1,2,,false,,,a", "arr.toString() = " + tmp);
419 tmp = arr.toString("test");
420 ok(tmp === "1,2,,false,,,a", "arr.toString() = " + tmp);
422 arr = [5,true,2,-1,3,false,"2.5"];
423 tmp = arr.sort(function(x,y) { return y-x; });
424 ok(tmp === arr, "tmp !== arr");
425 tmp = [5,3,"2.5",2,true,false,-1];
426 for(var i=0; i < arr.length; i++)
427     ok(arr[i] === tmp[i], "arr[" + i + "] = " + arr[i] + " expected " + tmp[i]);
429 arr = [5,false,2,0,"abc",3,"a",-1];
430 tmp = arr.sort();
431 ok(tmp === arr, "tmp !== arr");
432 tmp = [-1,0,2,3,5,"a","abc",false];
433 for(var i=0; i < arr.length; i++)
434     ok(arr[i] === tmp[i], "arr[" + i + "] = " + arr[i] + " expected " + tmp[i]);
436 arr = ["a", "b", "ab"];
437 tmp = ["a", "ab", "b"];
438 ok(arr.sort() === arr, "arr.sort() !== arr");
439 for(var i=0; i < arr.length; i++)
440     ok(arr[i] === tmp[i], "arr[" + i + "] = " + arr[i] + " expected " + tmp[i]);
442 var num = new Number(6);
443 arr = [0,1,2];
444 tmp = arr.concat(3, [4,5], num);
445 ok(tmp !== arr, "tmp === arr");
446 for(var i=0; i<6; i++)
447     ok(tmp[i] === i, "tmp[" + i + "] = " + tmp[i]);
448 ok(tmp[6] === num, "tmp[6] !== num");
449 ok(tmp.length === 7, "tmp.length = " + tmp.length);
451 arr = [].concat();
452 ok(arr.length === 0, "arr.length = " + arr.length);
454 arr = [1,];
455 tmp = arr.concat([2]);
456 ok(tmp.length === 3, "tmp.length = " + tmp.length);
457 ok(tmp[1] === undefined, "tmp[1] = " + tmp[1]);
459 var num = new Number(2);
460 ok(num.toString() === "2", "num(2).toString !== 2");
461 var num = new Number();
462 ok(num.toString() === "0", "num().toString !== 0");
464 ok(Number() === 0, "Number() = " + Number());
465 ok(Number(false) === 0, "Number(false) = " + Number(false));
466 ok(Number("43") === 43, "Number('43') = " + Number("43"));
468 tmp = (new Number(1)).valueOf();
469 ok(tmp === 1, "(new Number(1)).valueOf = " + tmp);
470 tmp = (new Number(1,2)).valueOf();
471 ok(tmp === 1, "(new Number(1,2)).valueOf = " + tmp);
472 tmp = (new Number()).valueOf();
473 ok(tmp === 0, "(new Number()).valueOf = " + tmp);
474 tmp = Number.prototype.valueOf();
475 ok(tmp === 0, "Number.prototype.valueOf = " + tmp);
477 tmp = Math.min(1);
478 ok(tmp === 1, "Math.min(1) = " + tmp);
480 tmp = Math.min(1, false);
481 ok(tmp === 0, "Math.min(1, false) = " + tmp);
483 tmp = Math.min();
484 ok(tmp === Infinity, "Math.min() = " + tmp);
486 tmp = Math.min(1, NaN, -Infinity, false);
487 ok(isNaN(tmp), "Math.min(1, NaN, -Infinity, false) is not NaN");
489 tmp = Math.min(1, false, true, null, -3);
490 ok(tmp === -3, "Math.min(1, false, true, null, -3) = " + tmp);
492 tmp = Math.max(1);
493 ok(tmp === 1, "Math.max(1) = " + tmp);
495 tmp = Math.max(true, 0);
496 ok(tmp === 1, "Math.max(true, 0) = " + tmp);
498 tmp = Math.max(-2, false, true, null, 1);
499 ok(tmp === 1, "Math.max(-2, false, true, null, 1) = " + tmp);
501 tmp = Math.max();
502 ok(tmp === -Infinity, "Math.max() = " + tmp);
504 tmp = Math.max(true, NaN, 0);
505 ok(isNaN(tmp), "Math.max(true, NaN, 0) is not NaN");
507 tmp = Math.round(0.5);
508 ok(tmp === 1, "Math.round(0.5) = " + tmp);
510 tmp = Math.round(-0.5);
511 ok(tmp === 0, "Math.round(-0.5) = " + tmp);
513 tmp = Math.round(1.1);
514 ok(tmp === 1, "Math.round(1.1) = " + tmp);
516 tmp = Math.round(true);
517 ok(tmp === 1, "Math.round(true) = " + tmp);
519 tmp = Math.round(1.1, 3, 4);
520 ok(tmp === 1, "Math.round(1.1, 3, 4) = " + tmp);
522 tmp = Math.round();
523 ok(isNaN(tmp), "Math.round() is not NaN");
525 tmp = Math.ceil(0.5);
526 ok(tmp === 1, "Math.ceil(0.5) = " + tmp);
528 tmp = Math.ceil(-0.5);
529 ok(tmp === 0, "Math.ceil(-0.5) = " + tmp);
531 tmp = Math.ceil(1.1);
532 ok(tmp === 2, "Math.round(1.1) = " + tmp);
534 tmp = Math.ceil(true);
535 ok(tmp === 1, "Math.ceil(true) = " + tmp);
537 tmp = Math.ceil(1.1, 3, 4);
538 ok(tmp === 2, "Math.ceil(1.1, 3, 4) = " + tmp);
540 tmp = Math.ceil();
541 ok(isNaN(tmp), "ceil() is not NaN");
543 tmp = Math.floor(0.5);
544 ok(tmp === 0, "Math.floor(0.5) = " + tmp);
546 tmp = Math.floor(-0.5);
547 ok(tmp === -1, "Math.floor(-0.5) = " + tmp);
549 tmp = Math.floor(1.1);
550 ok(tmp === 1, "Math.floor(1.1) = " + tmp);
552 tmp = Math.floor(true);
553 ok(tmp === 1, "Math.floor(true) = " + tmp);
555 tmp = Math.floor(1.1, 3, 4);
556 ok(tmp === 1, "Math.floor(1.1, 3, 4) = " + tmp);
558 tmp = Math.floor();
559 ok(isNaN(tmp), "floor is not NaN");
561 tmp = Math.abs(3);
562 ok(tmp === 3, "Math.abs(3) = " + tmp);
564 tmp = Math.abs(-3);
565 ok(tmp === 3, "Math.abs(-3) = " + tmp);
567 tmp = Math.abs(true);
568 ok(tmp === 1, "Math.abs(true) = " + tmp);
570 tmp = Math.abs();
571 ok(isNaN(tmp), "Math.abs() is not NaN");
573 tmp = Math.abs(NaN);
574 ok(isNaN(tmp), "Math.abs() is not NaN");
576 tmp = Math.abs(-Infinity);
577 ok(tmp === Infinity, "Math.abs(-Infinite) = " + tmp);
579 tmp = Math.abs(-3, 2);
580 ok(tmp === 3, "Math.abs(-3, 2) = " + tmp);
582 tmp = Math.cos(0);
583 ok(tmp === 1, "Math.cos(0) = " + tmp);
585 tmp = Math.cos(Math.PI/2);
586 ok(Math.floor(tmp*100) === 0, "Math.cos(Math.PI/2) = " + tmp);
588 tmp = Math.cos(-Math.PI/2);
589 ok(Math.floor(tmp*100) === 0, "Math.cos(-Math.PI/2) = " + tmp);
591 tmp = Math.cos(Math.PI/3, 2);
592 ok(Math.floor(tmp*100) === 50, "Math.cos(Math.PI/3, 2) = " + tmp);
594 tmp = Math.cos(true);
595 ok(Math.floor(tmp*100) === 54, "Math.cos(true) = " + tmp);
597 tmp = Math.cos(false);
598 ok(tmp === 1, "Math.cos(false) = " + tmp);
600 tmp = Math.cos();
601 ok(isNaN(tmp), "Math.cos() is not NaN");
603 tmp = Math.cos(NaN);
604 ok(isNaN(tmp), "Math.cos(NaN) is not NaN");
606 tmp = Math.cos(Infinity);
607 ok(isNaN(tmp), "Math.cos(Infinity) is not NaN");
609 tmp = Math.cos(-Infinity);
610 ok(isNaN(tmp), "Math.cos(-Infinity) is not NaN");
612 tmp = Math.pow(2, 2);
613 ok(tmp === 4, "Math.pow(2, 2) = " + tmp);
615 tmp = Math.pow(4, 0.5);
616 ok(tmp === 2, "Math.pow(2, 2) = " + tmp);
618 tmp = Math.pow(2, 2, 3);
619 ok(tmp === 4, "Math.pow(2, 2, 3) = " + tmp);
621 tmp = Math.pow(2);
622 ok(isNaN(tmp), "Math.pow(2) is not NaN");
624 tmp = Math.pow();
625 ok(isNaN(tmp), "Math.pow() is not NaN");
627 tmp = Math.random();
628 ok(typeof(tmp) == "number", "typeof(tmp) = " + typeof(tmp));
629 ok(0 <= tmp && tmp <= 1, "Math.random() = " + tmp);
631 tmp = Math.random(100);
632 ok(typeof(tmp) == "number", "typeof(tmp) = " + typeof(tmp));
633 ok(0 <= tmp && tmp <= 1, "Math.random(100) = " + tmp);
635 tmp = Math.acos(0);
636 ok(Math.floor(tmp*100) === 157, "Math.acos(0) = " + tmp);
638 tmp = Math.acos(1);
639 ok(Math.floor(tmp*100) === 0, "Math.acos(1) = " + tmp);
641 tmp = Math.acos(-1);
642 ok(Math.floor(tmp*100) === 314, "Math.acos(-1) = " + tmp);
644 tmp = Math.acos(Math.PI/4, 2);
645 ok(Math.floor(tmp*100) === 66, "Math.acos(Math.PI/4, 2) = " + tmp);
647 tmp = Math.acos(true);
648 ok(Math.floor(tmp*100) === 0, "Math.acos(true) = " + tmp);
650 tmp = Math.acos(false);
651 ok(Math.floor(tmp*100) === 157, "Math.acos(false) = " + tmp);
653 tmp = Math.acos(1.1);
654 ok(isNaN(tmp), "Math.acos(1.1) is not NaN");
656 tmp = Math.acos();
657 ok(isNaN(tmp), "Math.acos() is not NaN");
659 tmp = Math.acos(NaN);
660 ok(isNaN(tmp), "Math.acos(NaN) is not NaN");
662 tmp = Math.acos(Infinity);
663 ok(isNaN(tmp), "Math.acos(Infinity) is not NaN");
665 tmp = Math.acos(-Infinity);
666 ok(isNaN(tmp), "Math.acos(-Infinity) is not NaN");
668 tmp = Math.asin(0);
669 ok(Math.floor(tmp*100) === 0, "Math.asin(0) = " + tmp);
671 tmp = Math.asin(1);
672 ok(Math.floor(tmp*100) === 157, "Math.asin(1) = " + tmp);
674 tmp = Math.asin(-1);
675 ok(Math.floor(tmp*100) === -158, "Math.asin(-1) = " + tmp);
677 tmp = Math.asin(Math.PI/4, 2);
678 ok(Math.floor(tmp*100) === 90, "Math.asin(Math.PI/4, 2) = " + tmp);
680 tmp = Math.asin(true);
681 ok(Math.floor(tmp*100) === 157, "Math.asin(true) = " + tmp);
683 tmp = Math.asin(false);
684 ok(Math.floor(tmp*100) === 0, "Math.asin(false) = " + tmp);
686 tmp = Math.asin(1.1);
687 ok(isNaN(tmp), "Math.asin(1.1) is not NaN");
689 tmp = Math.asin();
690 ok(isNaN(tmp), "Math.asin() is not NaN");
692 tmp = Math.asin(NaN);
693 ok(isNaN(tmp), "Math.asin(NaN) is not NaN");
695 tmp = Math.asin(Infinity);
696 ok(isNaN(tmp), "Math.asin(Infinity) is not NaN");
698 tmp = Math.asin(-Infinity);
699 ok(isNaN(tmp), "Math.asin(-Infinity) is not NaN");
701 tmp = Math.atan(0);
702 ok(Math.floor(tmp*100) === 0, "Math.atan(0) = " + tmp);
704 tmp = Math.atan(1);
705 ok(Math.floor(tmp*100) === 78, "Math.atan(1) = " + tmp);
707 tmp = Math.atan(-1);
708 ok(Math.floor(tmp*100) === -79, "Math.atan(-1) = " + tmp);
710 tmp = Math.atan(true);
711 ok(Math.floor(tmp*100) === 78, "Math.atan(true) = " + tmp);
713 tmp = Math.atan(false);
714 ok(Math.floor(tmp*100) === 0, "Math.atan(false) = " + tmp);
716 tmp = Math.atan();
717 ok(isNaN(tmp), "Math.atan() is not NaN");
719 tmp = Math.atan(NaN);
720 ok(isNaN(tmp), "Math.atan(NaN) is not NaN");
722 tmp = Math.atan(Infinity);
723 ok(Math.floor(tmp*100) === 157, "Math.atan(Infinity) = " + tmp);
725 tmp = Math.atan(-Infinity);
726 ok(Math.floor(tmp*100) === -158, "Math.atan(Infinity) = " + tmp);
728 tmp = Math.atan2(0, 0);
729 ok(Math.floor(tmp*100) === 0, "Math.atan2(0, 0) = " + tmp);
731 tmp = Math.atan2(0, 1);
732 ok(Math.floor(tmp*100) === 0, "Math.atan2(0, 1) = " + tmp);
734 tmp = Math.atan2(0, Infinity);
735 ok(Math.floor(tmp*100) === 0, "Math.atan2(0, Infinity) = " + tmp);
737 tmp = Math.atan2(0, -1);
738 ok(Math.floor(tmp*100) === 314, "Math.atan2(0, -1) = " + tmp);
740 tmp = Math.atan2(0, -Infinity);
741 ok(Math.floor(tmp*100) === 314, "Math.atan2(0, -Infinity) = " + tmp);
743 tmp = Math.atan2(1, 0);
744 ok(Math.floor(tmp*100) === 157, "Math.atan2(1, 0) = " + tmp);
746 tmp = Math.atan2(Infinity, 0);
747 ok(Math.floor(tmp*100) === 157, "Math.atan2(Infinity, 0) = " + tmp);
749 tmp = Math.atan2(-1, 0);
750 ok(Math.floor(tmp*100) === -158, "Math.atan2(-1, 0) = " + tmp);
752 tmp = Math.atan2(-Infinity, 0);
753 ok(Math.floor(tmp*100) === -158, "Math.atan2(-Infinity, 0) = " + tmp);
755 tmp = Math.atan2(1, 1);
756 ok(Math.floor(tmp*100) === 78, "Math.atan2(1, 1) = " + tmp);
758 tmp = Math.atan2(-1, -1);
759 ok(Math.floor(tmp*100) === -236, "Math.atan2(-1, -1) = " + tmp);
761 tmp = Math.atan2(-1, 1);
762 ok(Math.floor(tmp*100) === -79, "Math.atan2(-1, 1) = " + tmp);
764 tmp = Math.atan2(Infinity, Infinity);
765 ok(Math.floor(tmp*100) === 78, "Math.atan2(Infinity, Infinity) = " + tmp);
767 tmp = Math.atan2(Infinity, -Infinity, 1);
768 ok(Math.floor(tmp*100) === 235, "Math.atan2(Infinity, -Infinity, 1) = " + tmp);
770 tmp = Math.atan2();
771 ok(isNaN(tmp), "Math.atan2() is not NaN");
773 tmp = Math.atan2(1);
774 ok(isNaN(tmp), "Math.atan2(1) is not NaN");
776 tmp = Math.exp(0);
777 ok(tmp === 1, "Math.exp(0) = " + tmp);
779 tmp = Math.exp(1);
780 ok(Math.floor(tmp*100) === 271, "Math.exp(1) = " + tmp);
782 tmp = Math.exp(-1);
783 ok(Math.floor(tmp*100) === 36, "Math.exp(-1) = " + tmp);
785 tmp = Math.exp(true);
786 ok(Math.floor(tmp*100) === 271, "Math.exp(true) = " + tmp);
788 tmp = Math.exp(1, 1);
789 ok(Math.floor(tmp*100) === 271, "Math.exp(1, 1) = " + tmp);
791 tmp = Math.exp();
792 ok(isNaN(tmp), "Math.exp() is not NaN");
794 tmp = Math.exp(NaN);
795 ok(isNaN(tmp), "Math.exp(NaN) is not NaN");
797 tmp = Math.exp(Infinity);
798 ok(tmp === Infinity, "Math.exp(Infinity) = " + tmp);
800 tmp = Math.exp(-Infinity);
801 ok(tmp === 0, "Math.exp(-Infinity) = " + tmp);
803 tmp = Math.log(1);
804 ok(Math.floor(tmp*100) === 0, "Math.log(1) = " + tmp);
806 tmp = Math.log(-1);
807 ok(isNaN(tmp), "Math.log(-1) is not NaN");
809 tmp = Math.log(true);
810 ok(Math.floor(tmp*100) === 0, "Math.log(true) = " + tmp);
812 tmp = Math.log(1, 1);
813 ok(Math.floor(tmp*100) === 0, "Math.log(1, 1) = " + tmp);
815 tmp = Math.log();
816 ok(isNaN(tmp), "Math.log() is not NaN");
818 tmp = Math.log(NaN);
819 ok(isNaN(tmp), "Math.log(NaN) is not NaN");
821 tmp = Math.log(Infinity);
822 ok(tmp === Infinity, "Math.log(Infinity) = " + tmp);
824 tmp = Math.log(-Infinity);
825 ok(isNaN(tmp), "Math.log(-Infinity) is not NaN");
827 tmp = Math.sin(0);
828 ok(tmp === 0, "Math.sin(0) = " + tmp);
830 tmp = Math.sin(Math.PI/2);
831 ok(tmp === 1, "Math.sin(Math.PI/2) = " + tmp);
833 tmp = Math.sin(-Math.PI/2);
834 ok(tmp === -1, "Math.sin(-Math.PI/2) = " + tmp);
836 tmp = Math.sin(Math.PI/3, 2);
837 ok(Math.floor(tmp*100) === 86, "Math.sin(Math.PI/3, 2) = " + tmp);
839 tmp = Math.sin(true);
840 ok(Math.floor(tmp*100) === 84, "Math.sin(true) = " + tmp);
842 tmp = Math.sin(false);
843 ok(tmp === 0, "Math.sin(false) = " + tmp);
845 tmp = Math.sin();
846 ok(isNaN(tmp), "Math.sin() is not NaN");
848 tmp = Math.sin(NaN);
849 ok(isNaN(tmp), "Math.sin(NaN) is not NaN");
851 tmp = Math.sin(Infinity);
852 ok(isNaN(tmp), "Math.sin(Infinity) is not NaN");
854 tmp = Math.sin(-Infinity);
855 ok(isNaN(tmp), "Math.sin(-Infinity) is not NaN");
857 tmp = Math.sqrt(0);
858 ok(tmp === 0, "Math.sqrt(0) = " + tmp);
860 tmp = Math.sqrt(4);
861 ok(tmp === 2, "Math.sqrt(4) = " + tmp);
863 tmp = Math.sqrt(-1);
864 ok(isNaN(tmp), "Math.sqrt(-1) is not NaN");
866 tmp = Math.sqrt(2, 2);
867 ok(Math.floor(tmp*100) === 141, "Math.sqrt(2, 2) = " + tmp);
869 tmp = Math.sqrt(true);
870 ok(tmp === 1, "Math.sqrt(true) = " + tmp);
872 tmp = Math.sqrt(false);
873 ok(tmp === 0, "Math.sqrt(false) = " + tmp);
875 tmp = Math.sqrt();
876 ok(isNaN(tmp), "Math.sqrt() is not NaN");
878 tmp = Math.sqrt(NaN);
879 ok(isNaN(tmp), "Math.sqrt(NaN) is not NaN");
881 tmp = Math.sqrt(Infinity);
882 ok(tmp === Infinity, "Math.sqrt(Infinity) = " + tmp);
884 tmp = Math.sqrt(-Infinity);
885 ok(isNaN(tmp), "Math.sqrt(-Infinity) is not NaN");
887 tmp = Math.tan(0);
888 ok(tmp === 0, "Math.tan(0) = " + tmp);
890 tmp = Math.tan(Math.PI);
891 ok(Math.floor(tmp*100) === -1, "Math.tan(Math.PI) = " + tmp);
893 tmp = Math.tan(2, 2);
894 ok(Math.floor(tmp*100) === -219, "Math.tan(2, 2) = " + tmp);
896 tmp = Math.tan(true);
897 ok(Math.floor(tmp*100) === 155, "Math.tan(true) = " + tmp);
899 tmp = Math.tan(false);
900 ok(tmp === 0, "Math.tan(false) = " + tmp);
902 tmp = Math.tan();
903 ok(isNaN(tmp), "Math.tan() is not NaN");
905 tmp = Math.tan(NaN);
906 ok(isNaN(tmp), "Math.tan(NaN) is not NaN");
908 tmp = Math.tan(Infinity);
909 ok(isNaN(tmp), "Math.tan(Infinity) is not NaN");
911 tmp = Math.tan(-Infinity);
912 ok(isNaN(tmp), "Math.tan(-Infinity) is not NaN");
914 var func = function  (a) {
915         var a = 1;
916         if(a) return;
917     }.toString();
918 ok(func.toString() === "function  (a) {\n        var a = 1;\n        if(a) return;\n    }",
919    "func.toString() = " + func.toString());
920 ok("" + func === "function  (a) {\n        var a = 1;\n        if(a) return;\n    }",
921    "'' + func.toString() = " + func);
923 function testFuncToString(x,y) {
924     return x+y;
927 ok(testFuncToString.toString() === "function testFuncToString(x,y) {\n    return x+y;\n}",
928    "testFuncToString.toString() = " + testFuncToString.toString());
929 ok("" + testFuncToString === "function testFuncToString(x,y) {\n    return x+y;\n}",
930    "'' + testFuncToString = " + testFuncToString);
932 var date = new Date();
934 date = new Date(100);
935 ok(date.getTime() === 100, "date.getTime() = " + date.getTime());
936 ok(Date.prototype.getTime() === 0, "date.prototype.getTime() = " + Date.prototype.getTime());
937 date = new Date(8.64e15);
938 ok(date.getTime() === 8.64e15, "date.getTime() = " + date.getTime());
939 date = new Date(8.64e15+1);
940 ok(isNaN(0+date.getTime()), "date.getTime() is not NaN");
941 date = new Date(Infinity);
942 ok(isNaN(0+date.getTime()), "date.getTime() is not NaN");
944 ok(date.setTime(123) === 123, "date.setTime(123) !== 123");
945 ok(date.setTime("123", NaN) === 123, "date.setTime(\"123\") !== 123");
946 ok(isNaN(date.setTime(NaN)), "date.setTime(NaN) is not NaN");
948 ok(date.setTime(0) === date.getTime(), "date.setTime(0) !== date.getTime()");
949 ok(date.getUTCFullYear() === 1970, "date.getUTCFullYear() = " + date.getUTCFullYear());
950 ok(date.getUTCMonth() === 0, "date.getUTCMonth() = " + date.getUTCMonth());
951 ok(date.getUTCDate() === 1, "date.getUTCDate() = " + date.getUTCDate());
952 ok(date.getUTCDay() === 4, "date.getUTCDay() = " + date.getUTCDay());
953 ok(date.getUTCHours() === 0, "date.getUTCHours() = " + date.getUTCHours());
954 ok(date.getUTCMinutes() === 0, "date.getUTCMinutes() = " + date.getUTCMinutes());
955 ok(date.getUTCSeconds() === 0, "date.getUTCSeconds() = " + date.getUTCSeconds());
956 ok(date.getUTCMilliseconds() === 0, "date.getUTCMilliseconds() = " + date.getUTCMilliseconds());
957 date.setTime(60*24*60*60*1000);
958 ok(date.getUTCFullYear() === 1970, "date.getUTCFullYear() = " + date.getUTCFullYear());
959 ok(date.getUTCMonth() === 2, "date.getUTCMonth() = " + date.getUTCMonth());
960 ok(date.getUTCDate() === 2, "date.getUTCDate() = " + date.getUTCDate());
961 ok(date.getUTCDay() === 1, "date.getUTCDay() = " + date.getUTCDay());
962 ok(date.getUTCHours() === 0, "date.getUTCHours() = " + date.getUTCHours());
963 ok(date.getUTCMinutes() === 0, "date.getUTCMinutes() = " + date.getUTCMinutes());
964 ok(date.getUTCSeconds() === 0, "date.getUTCSeconds() = " + date.getUTCSeconds());
965 ok(date.getUTCMilliseconds() === 0, "date.getUTCMilliseconds() = " + date.getUTCMilliseconds());
966 date.setTime(59*24*60*60*1000 + 4*365*24*60*60*1000 + 60*60*1000 + 2*60*1000 + 2*1000 + 640);
967 ok(date.getUTCFullYear() === 1974, "date.getUTCFullYear() = " + date.getUTCFullYear());
968 ok(date.getUTCMonth() === 1, "date.getUTCMonth() = " + date.getUTCMonth());
969 ok(date.getUTCMonth(123) === 1, "date.getUTCMonth() = " + date.getUTCMonth());
970 ok(date.getUTCDate() === 28, "date.getUTCDate() = " + date.getUTCDate());
971 ok(date.getUTCDay() === 4, "date.getUTCDay() = " + date.getUTCDay());
972 ok(date.getUTCHours() === 1, "date.getUTCHours() = " + date.getUTCHours());
973 ok(date.getUTCMinutes() === 2, "date.getUTCMinutes() = " + date.getUTCMinutes());
974 ok(date.getUTCSeconds() === 2, "date.getUTCSeconds() = " + date.getUTCSeconds());
975 ok(date.getUTCMilliseconds() === 640, "date.getUTCMilliseconds() = " + date.getUTCMilliseconds());
976 date.setTime(Infinity);
977 ok(isNaN(date.getUTCFullYear()), "date.getUTCFullYear() is not NaN");
978 ok(isNaN(date.getUTCMonth()), "date.getUTCMonth() is not NaN");
979 ok(isNaN(date.getUTCDate()), "date.getUTCDate() is not NaN");
980 ok(isNaN(date.getUTCDay()), "date.getUTCDay() is not NaN");
981 ok(isNaN(date.getUTCHours()), "date.getUTCHours() is not NaN");
982 ok(isNaN(date.getUTCMinutes()), "date.getUTCMinutes() is not NaN");
983 ok(isNaN(date.getUTCSeconds()), "date.getUTCSeconds() is not NaN");
984 ok(isNaN(date.getUTCMilliseconds()), "date.getUTCMilliseconds() is not NaN");
985 ok(isNaN(date.setMilliseconds(0)), "date.setMilliseconds() is not NaN");
987 date.setTime(0);
988 date.setMilliseconds(-10, 2);
989 ok(date.getUTCMilliseconds() === 990, "date.getUTCMilliseconds() = " + date.getUTCMilliseconds());
990 ok(date.setMilliseconds(10) === date.setUTCMilliseconds(10), "date.setUTCMilliseconds(10) !== date.setUTCMilliseconds(10)");
991 date.setSeconds(-10);
992 ok(date.getUTCSeconds() === 50, "date.getUTCSeconds() = " + date.getUTCSeconds());
993 ok(date.setSeconds(10) === date.setUTCSeconds(10), "date.setUTCSeconds(10) !== date.setUTCSeconds(10)");
994 date.setMinutes(-10);
995 ok(date.getUTCMinutes() === 50, "date.getUTCMinutes() = " + date.getUTCMinutes());
996 ok(date.setMinutes(10) === date.setUTCMinutes(10), "date.setUTCMinutes(10) !== date.setUTCMinutes(10)");
997 date.setUTCHours(-10);
998 ok(date.getUTCHours() === 14, "date.getUTCHours() = " + date.getUTCHours());
999 date.setUTCHours(-123);
1000 ok(date.getTime() === -614989990, "date.getTime() = " + date.getTime());
1001 date.setHours(20);
1002 ok(date.getHours() === 20, "date.getHours() = " + date.getHours());
1004 ok(typeof(Math.PI) === "number", "typeof(Math.PI) = " + typeof(Math.PI));
1005 ok(Math.floor(Math.PI*100) === 314, "Math.PI = " + Math.PI);
1006 Math.PI = "test";
1007 ok(Math.floor(Math.PI*100) === 314, "modified Math.PI = " + Math.PI);
1009 ok(typeof(Math.E) === "number", "typeof(Math.E) = " + typeof(Math.E));
1010 ok(Math.floor(Math.E*100) === 271, "Math.E = " + Math.E);
1011 Math.E = "test";
1012 ok(Math.floor(Math.E*100) === 271, "modified Math.E = " + Math.E);
1014 ok(typeof(Math.LOG2E) === "number", "typeof(Math.LOG2E) = " + typeof(Math.LOG2E));
1015 ok(Math.floor(Math.LOG2E*100) === 144, "Math.LOG2E = " + Math.LOG2E);
1016 Math.LOG2E = "test";
1017 ok(Math.floor(Math.LOG2E*100) === 144, "modified Math.LOG2E = " + Math.LOG2E);
1019 ok(typeof(Math.LOG10E) === "number", "typeof(Math.LOG10E) = " + typeof(Math.LOG10E));
1020 ok(Math.floor(Math.LOG10E*100) === 43, "Math.LOG10E = " + Math.LOG10E);
1021 Math.LOG10E = "test";
1022 ok(Math.floor(Math.LOG10E*100) === 43, "modified Math.LOG10E = " + Math.LOG10E);
1024 ok(typeof(Math.LN2) === "number", "typeof(Math.LN2) = " + typeof(Math.LN2));
1025 ok(Math.floor(Math.LN2*100) === 69, "Math.LN2 = " + Math.LN2);
1026 Math.LN2 = "test";
1027 ok(Math.floor(Math.LN2*100) === 69, "modified Math.LN2 = " + Math.LN2);
1029 ok(typeof(Math.LN10) === "number", "typeof(Math.LN10) = " + typeof(Math.LN10));
1030 ok(Math.floor(Math.LN10*100) === 230, "Math.LN10 = " + Math.LN10);
1031 Math.LN10 = "test";
1032 ok(Math.floor(Math.LN10*100) === 230, "modified Math.LN10 = " + Math.LN10);
1034 ok(typeof(Math.SQRT2) === "number", "typeof(Math.SQRT2) = " + typeof(Math.SQRT2));
1035 ok(Math.floor(Math.SQRT2*100) === 141, "Math.SQRT2 = " + Math.SQRT2);
1036 Math.SQRT2 = "test";
1037 ok(Math.floor(Math.SQRT2*100) === 141, "modified Math.SQRT2 = " + Math.SQRT2);
1039 ok(typeof(Math.SQRT1_2) === "number", "typeof(Math.SQRT1_2) = " + typeof(Math.SQRT1_2));
1040 ok(Math.floor(Math.SQRT1_2*100) === 70, "Math.SQRT1_2 = " + Math.SQRT1_2);
1041 Math.SQRT1_2 = "test";
1042 ok(Math.floor(Math.SQRT1_2*100) === 70, "modified Math.SQRT1_2 = " + Math.SQRT1_2);
1044 reportSuccess();