Imported Upstream version 1.0.0
[platform/upstream/js.git] / js / src / tests / ecma / TypeConversion / 9.3.1-3.js
1 /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
2 /* ***** BEGIN LICENSE BLOCK *****
3  * Version: MPL 1.1/GPL 2.0/LGPL 2.1
4  *
5  * The contents of this file are subject to the Mozilla Public License Version
6  * 1.1 (the "License"); you may not use this file except in compliance with
7  * the License. You may obtain a copy of the License at
8  * http://www.mozilla.org/MPL/
9  *
10  * Software distributed under the License is distributed on an "AS IS" basis,
11  * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
12  * for the specific language governing rights and limitations under the
13  * License.
14  *
15  * The Original Code is Mozilla Communicator client code, released
16  * March 31, 1998.
17  *
18  * The Initial Developer of the Original Code is
19  * Netscape Communications Corporation.
20  * Portions created by the Initial Developer are Copyright (C) 1998
21  * the Initial Developer. All Rights Reserved.
22  *
23  * Contributor(s):
24  *
25  * Alternatively, the contents of this file may be used under the terms of
26  * either the GNU General Public License Version 2 or later (the "GPL"), or
27  * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
28  * in which case the provisions of the GPL or the LGPL are applicable instead
29  * of those above. If you wish to allow use of your version of this file only
30  * under the terms of either the GPL or the LGPL, and not to allow others to
31  * use your version of this file under the terms of the MPL, indicate your
32  * decision by deleting the provisions above and replace them with the notice
33  * and other provisions required by the GPL or the LGPL. If you do not delete
34  * the provisions above, a recipient may use your version of this file under
35  * the terms of any one of the MPL, the GPL or the LGPL.
36  *
37  * ***** END LICENSE BLOCK ***** */
38
39
40 /**
41    File Name:          9.3.1-3.js
42    ECMA Section:       9.3  Type Conversion:  ToNumber
43    Description:        rules for converting an argument to a number.
44    see 9.3.1 for cases for converting strings to numbers.
45    special cases:
46    undefined           NaN
47    Null                NaN
48    Boolean             1 if true; +0 if false
49    Number              the argument ( no conversion )
50    String              see test 9.3.1
51    Object              see test 9.3-1
52
53
54    Test cases provided by waldemar.
55
56
57    Author:             christine@netscape.com
58    Date:               10 june 1998
59
60 */
61
62 var SECTION = "9.3.1-3";
63 var VERSION = "ECMA_1";
64 var BUGNUMBER="129087";
65
66 var TITLE   = "Number To String, String To Number";
67
68 startTest();
69
70 writeHeaderToLog( SECTION + " "+ TITLE);
71
72 // test case from http://scopus.mcom.com/bugsplat/show_bug.cgi?id=312954
73 var z = 0;
74
75 new TestCase(
76   SECTION,
77   "var z = 0; print(1/-z)",
78   -Infinity,
79   1/-z );
80
81
82
83
84
85 // test cases from bug http://scopus.mcom.com/bugsplat/show_bug.cgi?id=122882
86
87
88
89 new TestCase( SECTION,
90               '- -"0x80000000"',
91               2147483648,
92               - -"0x80000000" );
93
94 new TestCase( SECTION,
95               '- -"0x100000000"',
96               4294967296,
97               - -"0x100000000" );
98
99 new TestCase( SECTION,
100               '- "-0x123456789abcde8"',
101               NaN,
102               - "-0x123456789abcde8" );
103
104 new TestCase( SECTION,
105               '- "+0x123456789abcde8"',
106               NaN,
107               - "+0x123456789abcde8" );
108
109 // Convert some large numbers to string
110
111
112 new TestCase( SECTION,
113               "1e2000 +''",
114               "Infinity",
115               1e2000 +"" );
116
117 new TestCase( SECTION,
118               "1e2000",
119               Infinity,
120               1e2000 );
121
122 new TestCase( SECTION,
123               "-1e2000 +''",
124               "-Infinity",
125               -1e2000 +"" );
126
127 new TestCase( SECTION,
128               "-\"1e2000\"",
129               -Infinity,
130               -"1e2000" );
131
132 new TestCase( SECTION,
133               "-\"-1e2000\" +''",
134               "Infinity",
135               -"-1e2000" +"" );
136
137 new TestCase( SECTION,
138               "1e-2000",
139               0,
140               1e-2000 );
141
142 new TestCase( SECTION,
143               "1/1e-2000",
144               Infinity,
145               1/1e-2000 );
146
147 // convert some strings to large numbers
148
149 new TestCase( SECTION,
150               "1/-1e-2000",
151               -Infinity,
152               1/-1e-2000 );
153
154 new TestCase( SECTION,
155               "1/\"1e-2000\"",
156               Infinity,
157               1/"1e-2000" );
158
159 new TestCase( SECTION,
160               "1/\"-1e-2000\"",
161               -Infinity,
162               1/"-1e-2000" );
163
164 new TestCase( SECTION,
165               "parseFloat(\"1e2000\")",
166               Infinity,
167               parseFloat("1e2000") );
168
169 new TestCase( SECTION,
170               "parseFloat(\"1e-2000\")",
171               0,
172               parseFloat("1e-2000") );
173
174 new TestCase( SECTION,
175               "1.7976931348623157E+308",
176               1.7976931348623157e+308,
177               1.7976931348623157E+308 );
178
179 new TestCase( SECTION,
180               "1.7976931348623158e+308",
181               1.7976931348623157e+308,
182               1.7976931348623158e+308 );
183
184 new TestCase( SECTION,
185               "1.7976931348623159e+308",
186               Infinity,
187               1.7976931348623159e+308 );
188
189 s =
190   "17976931348623158079372897140530341507993413271003782693617377898044496829276475094664901797758720709633028641669288791094655554785194040263065748867150582068";
191
192 print("s = " + s);
193 print("-s = " + (-s));
194
195 new TestCase( SECTION,
196               "s = " + s +"; s +="+
197               "\"190890200070838367627385484581771153176447573027006985557136695962284291481986083493647529271907416844436551070434271155969950809304288017790417449779\""+
198
199               +"; s",
200               "17976931348623158079372897140530341507993413271003782693617377898044496829276475094664901797758720709633028641669288791094655554785194040263065748867150582068190890200070838367627385484581771153176447573027006985557136695962284291481986083493647529271907416844436551070434271155969950809304288017790417449779",
201               s +=
202               "190890200070838367627385484581771153176447573027006985557136695962284291481986083493647529271907416844436551070434271155969950809304288017790417449779"
203   );
204
205 s1 = s+1;
206
207 print("s1 = " + s1);
208 print("-s1 = " + (-s1));
209
210 new TestCase( SECTION,
211               "s1 = s+1; s1",
212               "179769313486231580793728971405303415079934132710037826936173778980444968292764750946649017977587207096330286416692887910946555547851940402630657488671505820681908902000708383676273854845817711531764475730270069855571366959622842914819860834936475292719074168444365510704342711559699508093042880177904174497791",
213               s1 );
214
215 /***** This answer is preferred but -Infinity is also acceptable here *****/
216
217 new TestCase( SECTION,
218               "-s1 == Infinity || s1 == 1.7976931348623157e+308",
219               true,
220               -s1 == Infinity || s1 == 1.7976931348623157e+308 );
221
222 s2 = s + 2;
223
224 print("s2 = " + s2);
225 print("-s2 = " + (-s2));
226
227 new TestCase( SECTION,
228               "s2 = s+2; s2",
229               "179769313486231580793728971405303415079934132710037826936173778980444968292764750946649017977587207096330286416692887910946555547851940402630657488671505820681908902000708383676273854845817711531764475730270069855571366959622842914819860834936475292719074168444365510704342711559699508093042880177904174497792",
230               s2 );
231
232 // ***** This answer is preferred but -1.7976931348623157e+308 is also acceptable here *****
233 new TestCase( SECTION,
234               "-s2 == -Infinity || -s2 == -1.7976931348623157e+308 ",
235               true,
236               -s2 == -Infinity || -s2 == -1.7976931348623157e+308 );
237
238 s3 = s+3;
239
240 print("s3 = " + s3);
241 print("-s3 = " + (-s3));
242
243 new TestCase( SECTION,
244               "s3 = s+3; s3",
245               "179769313486231580793728971405303415079934132710037826936173778980444968292764750946649017977587207096330286416692887910946555547851940402630657488671505820681908902000708383676273854845817711531764475730270069855571366959622842914819860834936475292719074168444365510704342711559699508093042880177904174497793",
246               s3 );
247
248 //***** This answer is preferred but -1.7976931348623157e+308 is also acceptable here *****
249
250 new TestCase( SECTION,
251               "-s3 == -Infinity || -s3 == -1.7976931348623157e+308",
252               true,
253               -s3 == -Infinity || -s3 == -1.7976931348623157e+308 );
254
255
256 //***** This answer is preferred but Infinity is also acceptable here *****
257
258 new TestCase( SECTION,
259               "parseInt(s1,10) == 1.7976931348623157e+308 || parseInt(s1,10) == Infinity",
260               true,
261               parseInt(s1,10) == 1.7976931348623157e+308 || parseInt(s1,10) == Infinity );
262
263 //***** This answer is preferred but 1.7976931348623157e+308 is also acceptable here *****
264 new TestCase( SECTION,
265               "parseInt(s2,10) == Infinity || parseInt(s2,10) == 1.7976931348623157e+308",
266               true ,
267               parseInt(s2,10) == Infinity || parseInt(s2,10) == 1.7976931348623157e+308 );
268
269 //***** This answer is preferred but Infinity is also acceptable here *****
270
271 new TestCase( SECTION,
272               "parseInt(s1) == 1.7976931348623157e+308 || parseInt(s1) == Infinity",
273               true,
274               parseInt(s1) == 1.7976931348623157e+308 || parseInt(s1) == Infinity);
275
276 //***** This answer is preferred but 1.7976931348623157e+308 is also acceptable here *****
277 new TestCase( SECTION,
278               "parseInt(s2) == Infinity || parseInt(s2) == 1.7976931348623157e+308",
279               true,
280               parseInt(s2) == Infinity || parseInt(s2) == 1.7976931348623157e+308 );
281
282 new TestCase( SECTION,
283               "0x12345678",
284               305419896,
285               0x12345678 );
286
287 new TestCase( SECTION,
288               "0x80000000",
289               2147483648,
290               0x80000000 );
291
292 new TestCase( SECTION,
293               "0xffffffff",
294               4294967295,
295               0xffffffff );
296
297 new TestCase( SECTION,
298               "0x100000000",
299               4294967296,
300               0x100000000 );
301
302 new TestCase( SECTION,
303               "077777777777777777",
304               2251799813685247,
305               077777777777777777 );
306
307 new TestCase( SECTION,
308               "077777777777777776",
309               2251799813685246,
310               077777777777777776 );
311
312 new TestCase( SECTION,
313               "0x1fffffffffffff",
314               9007199254740991,
315               0x1fffffffffffff );
316
317 new TestCase( SECTION,
318               "0x20000000000000",
319               9007199254740992,
320               0x20000000000000 );
321
322 new TestCase( SECTION,
323               "0x20123456789abc",
324               9027215253084860,
325               0x20123456789abc );
326
327 new TestCase( SECTION,
328               "0x20123456789abd",
329               9027215253084860,
330               0x20123456789abd );
331
332 new TestCase( SECTION,
333               "0x20123456789abe",
334               9027215253084862,
335               0x20123456789abe );
336
337 new TestCase( SECTION,
338               "0x20123456789abf",
339               9027215253084864,
340               0x20123456789abf );
341
342 /***** These test the round-to-nearest-or-even-if-equally-close rule *****/
343
344 new TestCase( SECTION,
345               "0x1000000000000080",
346               1152921504606847000,
347               0x1000000000000080 );
348
349 new TestCase( SECTION,
350               "0x1000000000000081",
351               1152921504606847200,
352               0x1000000000000081 );
353
354 new TestCase( SECTION,
355               "0x1000000000000100",
356               1152921504606847200,
357               0x1000000000000100 );
358 new TestCase( SECTION,
359               "0x100000000000017f",
360               1152921504606847200,
361               0x100000000000017f );
362
363 new TestCase( SECTION,
364               "0x1000000000000180",
365               1152921504606847500,
366               0x1000000000000180 );
367
368 new TestCase( SECTION,
369               "0x1000000000000181",
370               1152921504606847500,
371               0x1000000000000181 );
372
373 new TestCase( SECTION,
374               "0x10000000000001f0",
375               1152921504606847500,
376               0x10000000000001f0 );
377
378 new TestCase( SECTION,
379               "0x1000000000000200",
380               1152921504606847500,
381               0x1000000000000200 );
382
383 new TestCase( SECTION,
384               "0x100000000000027f",
385               1152921504606847500,
386               0x100000000000027f );
387
388 new TestCase( SECTION,
389               "0x1000000000000280",
390               1152921504606847500,
391               0x1000000000000280 );
392
393 new TestCase( SECTION,
394               "0x1000000000000281",
395               1152921504606847700,
396               0x1000000000000281 );
397
398 new TestCase( SECTION,
399               "0x10000000000002ff",
400               1152921504606847700,
401               0x10000000000002ff );
402
403 new TestCase( SECTION,
404               "0x1000000000000300",
405               1152921504606847700,
406               0x1000000000000300 );
407
408 new TestCase( SECTION,
409               "0x10000000000000000",
410               18446744073709552000,
411               0x10000000000000000 );
412
413 new TestCase( SECTION,
414               "parseInt(\"000000100000000100100011010001010110011110001001101010111100\",2)",
415               9027215253084860,
416               parseInt("000000100000000100100011010001010110011110001001101010111100",2) );
417
418 new TestCase( SECTION,
419               "parseInt(\"000000100000000100100011010001010110011110001001101010111101\",2)",
420               9027215253084860,
421               parseInt("000000100000000100100011010001010110011110001001101010111101",2) );
422
423 new TestCase( SECTION,
424               "parseInt(\"000000100000000100100011010001010110011110001001101010111111\",2)",
425               9027215253084864,
426               parseInt("000000100000000100100011010001010110011110001001101010111111",2) );
427
428 new TestCase( SECTION,
429               "parseInt(\"0000001000000001001000110100010101100111100010011010101111010\",2)",
430               18054430506169720,
431               parseInt("0000001000000001001000110100010101100111100010011010101111010",2));
432
433 new TestCase( SECTION,
434               "parseInt(\"0000001000000001001000110100010101100111100010011010101111011\",2)",
435               18054430506169724,
436               parseInt("0000001000000001001000110100010101100111100010011010101111011",2) );
437
438 new TestCase( SECTION,
439               "parseInt(\"0000001000000001001000110100010101100111100010011010101111100\",2)",
440               18054430506169724,
441               parseInt("0000001000000001001000110100010101100111100010011010101111100",2));
442
443 new TestCase( SECTION,
444               "parseInt(\"0000001000000001001000110100010101100111100010011010101111110\",2)",
445               18054430506169728,
446               parseInt("0000001000000001001000110100010101100111100010011010101111110",2));
447
448 new TestCase( SECTION,
449               "parseInt(\"yz\",35)",
450               34,
451               parseInt("yz",35) );
452
453 new TestCase( SECTION,
454               "parseInt(\"yz\",36)",
455               1259,
456               parseInt("yz",36) );
457
458 new TestCase( SECTION,
459               "parseInt(\"yz\",37)",
460               NaN,
461               parseInt("yz",37) );
462
463 new TestCase( SECTION,
464               "parseInt(\"+77\")",
465               77,
466               parseInt("+77") );
467
468 new TestCase( SECTION,
469               "parseInt(\"-77\",9)",
470               -70,
471               parseInt("-77",9) );
472
473 new TestCase( SECTION,
474               "parseInt(\"\\u20001234\\u2000\")",
475               1234,
476               parseInt("\u20001234\u2000") );
477
478 new TestCase( SECTION,
479               "parseInt(\"123456789012345678\")",
480               123456789012345680,
481               parseInt("123456789012345678") );
482
483 new TestCase( SECTION,
484               "parseInt(\"9\",8)",
485               NaN,
486               parseInt("9",8) );
487
488 new TestCase( SECTION,
489               "parseInt(\"1e2\")",
490               1,
491               parseInt("1e2") );
492
493 new TestCase( SECTION,
494               "parseInt(\"1.9999999999999999999\")",
495               1,
496               parseInt("1.9999999999999999999") );
497
498 new TestCase( SECTION,
499               "parseInt(\"0x10\")",
500               16,
501               parseInt("0x10") );
502
503 new TestCase( SECTION,
504               "parseInt(\"0x10\",10)",
505               0,
506               parseInt("0x10",10) );
507
508 new TestCase( SECTION,
509               "parseInt(\"0022\")",
510               18,
511               parseInt("0022") );
512
513 new TestCase( SECTION,
514               "parseInt(\"0022\",10)",
515               22,
516               parseInt("0022",10) );
517
518 new TestCase( SECTION,
519               "parseInt(\"0x1000000000000080\")",
520               1152921504606847000,
521               parseInt("0x1000000000000080") );
522
523 new TestCase( SECTION,
524               "parseInt(\"0x1000000000000081\")",
525               1152921504606847200,
526               parseInt("0x1000000000000081") );
527
528 s =
529   "0xFFFFFFFFFFFFF80000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000";
530
531 new TestCase( SECTION, "s = "+
532               "\"0xFFFFFFFFFFFFF80000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000\";"+
533               "s",
534               "0xFFFFFFFFFFFFF80000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000",
535               s );
536
537
538 new TestCase( SECTION, "s +="+
539               "\"0000000000000000000000000000000000000\"; s",
540               "0xFFFFFFFFFFFFF800000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000",
541               s += "0000000000000000000000000000000000000" );
542
543 new TestCase( SECTION, "-s",
544               -1.7976931348623157e+308,
545               -s );
546
547 s =
548   "0xFFFFFFFFFFFFF80000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000";
549
550 new TestCase( SECTION, "s ="+
551               "\"0xFFFFFFFFFFFFF80000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000\";"+
552               "s",
553               "0xFFFFFFFFFFFFF80000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000",
554               s );
555
556 new TestCase( SECTION,
557               "s += \"0000000000000000000000000000000000001\"",
558               "0xFFFFFFFFFFFFF800000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001",
559               s += "0000000000000000000000000000000000001" );
560
561 new TestCase( SECTION,
562               "-s",
563               -1.7976931348623157e+308,
564               -s );
565
566 s =
567   "0xFFFFFFFFFFFFFC0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000";
568
569 new TestCase( SECTION,
570               "s ="+
571               "\"0xFFFFFFFFFFFFFC0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000\";"+
572               "s",
573               "0xFFFFFFFFFFFFFC0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000",
574               s );
575
576
577 new TestCase( SECTION,
578               "s += \"0000000000000000000000000000000000000\"",
579               "0xFFFFFFFFFFFFFC00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000",
580               s += "0000000000000000000000000000000000000");
581
582
583 new TestCase( SECTION,
584               "-s",
585               -Infinity,
586               -s );
587
588 s =
589   "0xFFFFFFFFFFFFFB0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000";
590
591 new TestCase( SECTION,
592               "s = "+
593               "\"0xFFFFFFFFFFFFFB0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000\";s",
594               "0xFFFFFFFFFFFFFB0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000",
595               s);
596
597 new TestCase( SECTION,
598               "s += \"0000000000000000000000000000000000001\"",
599               "0xFFFFFFFFFFFFFB00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001",
600               s += "0000000000000000000000000000000000001" );
601
602 new TestCase( SECTION,
603               "-s",
604               -1.7976931348623157e+308,
605               -s );
606
607 new TestCase( SECTION,
608               "s += \"0\"",
609               "0xFFFFFFFFFFFFFB000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000010",
610               s += "0" );
611
612 new TestCase( SECTION,
613               "-s",
614               -Infinity,
615               -s );
616
617 new TestCase( SECTION,
618               "parseInt(s)",
619               Infinity,
620               parseInt(s) );
621
622 new TestCase( SECTION,
623               "parseInt(s,32)",
624               0,
625               parseInt(s,32) );
626
627 new TestCase( SECTION,
628               "parseInt(s,36)",
629               Infinity,
630               parseInt(s,36) );
631
632 new TestCase( SECTION,
633               "-\"\"",
634               0,
635               -"" );
636
637 new TestCase( SECTION,
638               "-\" \"",
639               0,
640               -" " );
641
642 new TestCase( SECTION,
643               "-\"999\"",
644               -999,
645               -"999" );
646
647 new TestCase( SECTION,
648               "-\" 999\"",
649               -999,
650               -" 999" );
651
652 new TestCase( SECTION,
653               "-\"\\t999\"",
654               -999,
655               -"\t999" );
656
657 new TestCase( SECTION,
658               "-\"013  \"",
659               -13,
660               -"013  " );
661
662 new TestCase( SECTION,
663               "-\"999\\t\"",
664               -999,
665               -"999\t" );
666
667 new TestCase( SECTION,
668               "-\"-Infinity\"",
669               Infinity,
670               -"-Infinity" );
671
672 new TestCase( SECTION,
673               "-\"+Infinity\"",
674               -Infinity,
675               -"+Infinity" );
676
677 new TestCase( SECTION,
678               "-\"+Infiniti\"",
679               NaN,
680               -"+Infiniti" );
681
682 new TestCase( SECTION,
683               "- -\"0x80000000\"",
684               2147483648,
685               - -"0x80000000" );
686
687 new TestCase( SECTION,
688               "- -\"0x100000000\"",
689               4294967296,
690               - -"0x100000000" );
691
692 new TestCase( SECTION,
693               "- \"-0x123456789abcde8\"",
694               NaN,
695               - "-0x123456789abcde8" );
696
697 new TestCase( SECTION,
698               "- \"+0x123456789abcde8\"",
699               NaN,
700               - "+0x123456789abcde8" );
701
702 // the following two tests are not strictly ECMA 1.0
703
704 new TestCase( SECTION,
705               "-\"\\u20001234\\u2001\"",
706               -1234,
707               -"\u20001234\u2001" );
708
709 new TestCase( SECTION,
710               "-\"\\u20001234\\0\"",
711               NaN,
712               -"\u20001234\0" );
713
714 new TestCase( SECTION,
715               "-\"0x10\"",
716               -16,
717               -"0x10" );
718
719 new TestCase( SECTION,
720               "-\"+\"",
721               NaN,
722               -"+" );
723
724 new TestCase( SECTION,
725               "-\"-\"",
726               NaN,
727               -"-" );
728
729 new TestCase( SECTION,
730               "-\"-0-\"",
731               NaN,
732               -"-0-" );
733
734 new TestCase( SECTION,
735               "-\"1e-\"",
736               NaN,
737               -"1e-" );
738
739 new TestCase( SECTION,
740               "-\"1e-1\"",
741               -0.1,
742               -"1e-1" );
743
744 test();
745
746