Home | History | Annotate | Download | only in webkit

Lines Matching refs:parseInt

24 description('Tests for the parseInt function.');
27 shouldBe("parseInt('123')", '123');
28 shouldBe("parseInt('123x4')", '123');
29 shouldBe("parseInt('-123')", '-123');
30 shouldBe("parseInt('0x123')", '0x123');
31 shouldBe("parseInt('0x123x4')", '0x123');
32 shouldBe("parseInt('-0x123x4')", '-0x123');
33 shouldBe("parseInt('-')", 'Number.NaN');
34 shouldBe("parseInt('0x')", 'Number.NaN');
35 shouldBe("parseInt('-0x')", 'Number.NaN');
38 shouldBe("parseInt('123', undefined)", '123');
39 shouldBe("parseInt('123', null)", '123');
40 shouldBe("parseInt('123', 0)", '123');
41 shouldBe("parseInt('123', 10)", '123');
42 shouldBe("parseInt('123', 16)", '0x123');
44 shouldBe("parseInt('0x123', undefined)", '0x123');
45 shouldBe("parseInt('0x123', null)", '0x123');
46 shouldBe("parseInt('0x123', 0)", '0x123');
47 shouldBe("parseInt('0x123', 10)", '0');
48 shouldBe("parseInt('0x123', 16)", '0x123');
51 shouldBe("parseInt(Math.pow(10, 20))", '100000000000000000000');
52 shouldBe("parseInt(Math.pow(10, 21))", '1');
53 shouldBe("parseInt(Math.pow(10, -6))", '0');
54 shouldBe("parseInt(Math.pow(10, -7))", '1');
55 shouldBe("parseInt(-Math.pow(10, 20))", '-100000000000000000000');
56 shouldBe("parseInt(-Math.pow(10, 21))", '-1');
57 shouldBe("parseInt(-Math.pow(10, -6))", '-0');
58 shouldBe("parseInt(-Math.pow(10, -7))", '-1');
61 shouldBe("parseInt('0')", '0');
62 shouldBe("parseInt('-0')", '-0');
63 shouldBe("parseInt(0)", '0');
64 shouldBe("parseInt(-0)", '0');
67 shouldBe("parseInt(2147483647)", '2147483647');
68 shouldBe("parseInt(2147483648)", '2147483648');
69 shouldBe("parseInt('2147483647')", '2147483647');
70 shouldBe("parseInt('2147483648')", '2147483648');
76 shouldBe("state = null; try { parseInt('123', throwingRadix); } catch (e) {} state;", '"throwingRadix"');
77 shouldBe("state = null; try { parseInt(throwingString, throwingRadix); } catch (e) {} state;", '"throwingString"');