swc/crates/swc_ecma_codegen/tests/fixture/number/input.js

124 lines
2.5 KiB
JavaScript
Raw Normal View History

const exp = 1000;
const Exp = 1000000000000;
const negativeExp = 0.00000001;
const huge = 1000000000001;
const big = 100000000001;
const fractional = 100.2300200;
const numeric_separators = 1_000_000_000_000;
const one = 1_000;
const two = 1_000_000;
const three = -1_000_000;
const bin = 0b0101_0101;
const oct = 0o0123_4567;
const hex = 0xDEAD_BEEF;
const fractional2 = 1_000.000_100;
const identifier = _1000;
const negate_identifier = -_1000;
const foo = 0.1;
const foo1 = +0.1;
const foo2 = -0.1;
const foo3 = 1050;
const foo4 = 100500;
const foo5 = 10005000;
const foo6 = 1000050000;
const foo7 = 0.1;
const foo8 = 0.01;
const foo9 = 0.001;
const foo10 = 0.0001;
const foo11 = 0.00001;
const foo12 = 0.000001;
const foo13 = 0.000024;
const foo14 = -0.000024;
const foo15 = 1e1;
const foo16 = 1e2;
const foo17 = 1e3;
const foo18 = 1e4;
const foo19 = 1e5;
const foo20 = 1e-1;
const foo21 = 1e-2;
const foo22 = 1e-3;
const foo23 = 1e-4;
const foo24 = 1e-5;
const foo25 = -1e-1;
const foo26 = -1e-2;
const foo27 = -1e-3;
const foo28 = -1e-4;
const foo29 = -1e-5;
const foo30 = 100e-5;
const foo31 = 321e-5;
const foo32 = 321e-6;
const foo33 = 1E-1;
const foo34 = 1E-5;
const foo35 = 000000;
const foo36 = -000000;
const foo37 = +000000;
const foo38 = 0.00001543;
const foo39 = 0.00001543000;
const foo40 = (0.00001543000);
const foo41 = { 1000050000: "foo" };
const foo42 = 1000000003242;
const foo43_ = -1000000003242;
const foo43 = 0.0;
const foo44 = -0.0;
const foo45 = +0.0;
const foo46 = 1_000_000_000
const foo47 = 1.1_00_01
const foo48 = 1e1_0
const foo49 = 1e+1_0
const foo50 = 1e-1_0
const foo51 = 1.1e10_0
const foo52 = 1.1e+10_0
const foo53 = 1.1e-10_0
const foo54 = 12_34_56
const foo55 = 1_22_333
const foo56 = 1_2.3_4
const foo57 = 1_2.3_4e5_6
const foo58 = 1_2.3_4e+5_6
const foo59 = 1_2.3_4e-5_6
const foo60 = 0.100;
const foo61 = 1E1;
const foo62 = 5e+9;
const foo63 = 0xff;
const foo64 = 0xFf;
const foo65 = 0xfF;
const foo66 = 0x00;
const foo67 = .0;
const foo68 = 0.0;
const foo69 = 000;
const foo70 = 0.0000;
const foo71 = 0XfF;
0032.toString();
0xffffffff.toString();
0Xffffffff.toString();
0o01234.toString();
0O01234.toString();
0b01101101.toString();
0B01101101.toString();
1234..toString();
1e0.toString();
77 .toExponential()
// or
77
.toExponential()
// or
;(77).toExponential()
// or
77..toExponential()
// or
77.0.toExponential()
const hugefoo = 1000000000001..test();
const hugefoo1 = 0xEE.test();
1_2_3_4..toString();
1_2_3_4 .toString();
const foo72 = 86400000;
const foo73 = 65535;
const foo74 = 0xffff;
const foo75 = Infinity;
const foo76 = Infinity.toString();