Commit a1d418ed authored by Sathya Gunasekaran's avatar Sathya Gunasekaran Committed by Commit Bot

[numeric separator] Add more tests for DecimalLiteral

Bug: v8:7317
Change-Id: I5b3072c84cf8d97c8ebfeb274d0f1134046666c9
Reviewed-on: https://chromium-review.googlesource.com/965063
Commit-Queue: Sathya Gunasekaran <gsathya@chromium.org>
Reviewed-by: 's avatarMathias Bynens <mathias@chromium.org>
Cr-Commit-Position: refs/heads/master@{#51989}
parent 17c2a994
...@@ -45,6 +45,17 @@ ...@@ -45,6 +45,17 @@
assertEquals(leadingZeros, 0913); assertEquals(leadingZeros, 0913);
} }
{
const dot1 = 9_1.1_3;
assertEquals(dot1, 91.13);
const dot2 = 1.1_3;
assertEquals(dot2, 1.13);
const dot3 = 1_1.21;
assertEquals(dot3, 11.21);
}
{ {
const basic = Number('1_2_3'); const basic = Number('1_2_3');
assertEquals(NaN, basic); assertEquals(NaN, basic);
...@@ -60,6 +71,12 @@ ...@@ -60,6 +71,12 @@
assertEquals(NaN, binary); assertEquals(NaN, binary);
const leadingZeros = Number('09_1_3'); const leadingZeros = Number('09_1_3');
assertEquals(NaN, leadingZeros); assertEquals(NaN, leadingZeros);
const dot1 = Number('9_1.1_3');
assertEquals(NaN, dot1);
const dot2 = Number('1.1_3');
assertEquals(NaN, dot2);
const dot3 = Number('1_1.21');
assertEquals(NaN, dot3);
} }
assertThrows('1_0_0_0_', SyntaxError); assertThrows('1_0_0_0_', SyntaxError);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment