LibJS: Add more number test cases for #1680

This commit is contained in:
Stephan Unverwerth 2020-04-13 16:56:20 +02:00 committed by Andreas Kling
parent 062d6af16e
commit 8f82f6c574
Notes: sideshowbarker 2024-07-19 07:37:44 +09:00

View file

@ -8,12 +8,19 @@ try {
assert(1e3 === 1000);
assert(1e+3 === 1000);
assert(1e-3 === 0.001);
assert(1. === 1);
assert(1.e1 === 10);
assert(.1 === 0.1);
assert(.1e1 === 1);
assert(0.1e1 === 1);
assert(.1e+1 === 1);
assert(0.1e+1 === 1);
Number.prototype.foo = 'LOL';
assert(1..foo === 'LOL');
assert(1.1.foo === 'LOL');
assert(.1.foo === 'LOL');
console.log("PASS");
} catch (e) {
console.log("FAIL: " + e);