|
| 1 | +=== tests/cases/compiler/numLit.ts === |
| 2 | +1..toString(); |
| 3 | +>1..toString : Symbol(Number.toString, Decl(lib.d.ts, 458, 18)) |
| 4 | +>toString : Symbol(Number.toString, Decl(lib.d.ts, 458, 18)) |
| 5 | + |
| 6 | +1.0.toString(); |
| 7 | +>1.0.toString : Symbol(Number.toString, Decl(lib.d.ts, 458, 18)) |
| 8 | +>toString : Symbol(Number.toString, Decl(lib.d.ts, 458, 18)) |
| 9 | + |
| 10 | +1.toString(); |
| 11 | +>1.toString : Symbol(Number.toString, Decl(lib.d.ts, 458, 18)) |
| 12 | +>toString : Symbol(Number.toString, Decl(lib.d.ts, 458, 18)) |
| 13 | + |
| 14 | +1.+2.0 + 3. ; |
| 15 | + |
| 16 | +// Preserve whitespace where important for JS compatibility |
| 17 | +var i: number = 1; |
| 18 | +>i : Symbol(i, Decl(numLit.ts, 6, 3)) |
| 19 | + |
| 20 | +var test1 = i.toString(); |
| 21 | +>test1 : Symbol(test1, Decl(numLit.ts, 7, 3)) |
| 22 | +>i.toString : Symbol(Number.toString, Decl(lib.d.ts, 458, 18)) |
| 23 | +>i : Symbol(i, Decl(numLit.ts, 6, 3)) |
| 24 | +>toString : Symbol(Number.toString, Decl(lib.d.ts, 458, 18)) |
| 25 | + |
| 26 | +var test2 = 2.toString(); // emitted as 2 .toString() |
| 27 | +>test2 : Symbol(test2, Decl(numLit.ts, 8, 3)) |
| 28 | +>2.toString : Symbol(Number.toString, Decl(lib.d.ts, 458, 18)) |
| 29 | +>toString : Symbol(Number.toString, Decl(lib.d.ts, 458, 18)) |
| 30 | + |
| 31 | +var test3 = 3 .toString(); |
| 32 | +>test3 : Symbol(test3, Decl(numLit.ts, 9, 3)) |
| 33 | +>3 .toString : Symbol(Number.toString, Decl(lib.d.ts, 458, 18)) |
| 34 | +>toString : Symbol(Number.toString, Decl(lib.d.ts, 458, 18)) |
| 35 | + |
| 36 | +var test4 = 3 .toString(); |
| 37 | +>test4 : Symbol(test4, Decl(numLit.ts, 10, 3)) |
| 38 | +>3 .toString : Symbol(Number.toString, Decl(lib.d.ts, 458, 18)) |
| 39 | +>toString : Symbol(Number.toString, Decl(lib.d.ts, 458, 18)) |
| 40 | + |
| 41 | +var test5 = 3 .toString(); |
| 42 | +>test5 : Symbol(test5, Decl(numLit.ts, 11, 3)) |
| 43 | +>3 .toString : Symbol(Number.toString, Decl(lib.d.ts, 458, 18)) |
| 44 | +>toString : Symbol(Number.toString, Decl(lib.d.ts, 458, 18)) |
| 45 | + |
| 46 | +var test6 = 3.['toString'](); |
| 47 | +>test6 : Symbol(test6, Decl(numLit.ts, 12, 3)) |
| 48 | +>'toString' : Symbol(Number.toString, Decl(lib.d.ts, 458, 18)) |
| 49 | + |
| 50 | +var test7 = 3 |
| 51 | +>test7 : Symbol(test7, Decl(numLit.ts, 13, 3)) |
| 52 | +>3.toString : Symbol(Number.toString, Decl(lib.d.ts, 458, 18)) |
| 53 | + |
| 54 | +.toString(); |
| 55 | +>toString : Symbol(Number.toString, Decl(lib.d.ts, 458, 18)) |
| 56 | + |
| 57 | +var test8 = new Number(4).toString(); |
| 58 | +>test8 : Symbol(test8, Decl(numLit.ts, 15, 3)) |
| 59 | +>new Number(4).toString : Symbol(Number.toString, Decl(lib.d.ts, 458, 18)) |
| 60 | +>Number : Symbol(Number, Decl(lib.d.ts, 456, 40), Decl(lib.d.ts, 518, 11)) |
| 61 | +>toString : Symbol(Number.toString, Decl(lib.d.ts, 458, 18)) |
| 62 | + |
| 63 | +var test9 = 3. + 3. |
| 64 | +>test9 : Symbol(test9, Decl(numLit.ts, 16, 3)) |
| 65 | + |
0 commit comments