blob: d7a4ccd0922cc53171baf3ed1224bdd2d5b7a6fe (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
|
/*
* Any copyright is dedicated to the Public Domain.
* http://creativecommons.org/licenses/publicdomain/
*/
//-----------------------------------------------------------------------------
var BUGNUMBER = 1596706;
var summary =
"Properly evaluate a bigint literal that's initially tokenized by a syntax " +
"parser (because the bigint literal appears immediately after an arrow " +
"function with expression body)";
print(BUGNUMBER + ": " + summary);
/**************
* BEGIN TEST *
**************/
// block followed by semicolon
assertEq(eval(`x=>{};
17n`), 17n);
// block not followed by semicolon
assertEq(eval(`x=>{}
42n`), 42n);
// expr followed by semicolon
assertEq(eval(`x=>y;
8675309n`), 8675309n);
// expr not followed by semicolon
assertEq(eval(`x=>y
78051120n`), 78051120n);
/******************************************************************************/
if (typeof reportCompare === "function")
reportCompare(true, true);
print("Tests complete");
|