support BigInt literals (#4583)

This commit is contained in:
Alex Lam S.L
2021-01-24 01:51:18 +00:00
committed by GitHub
parent ef9f7ca3e7
commit 8bfd891c09
10 changed files with 251 additions and 176 deletions

View File

@@ -134,6 +134,7 @@ var SUPPORT = function(matrix) {
}({
arrow: "a => 0;",
async: "async function f(){}",
bigint: "42n",
catch_omit_var: "try {} catch {}",
computed_key: "({[0]: 0});",
const_block: "var a; { const a = 0; }",
@@ -188,6 +189,12 @@ var VALUES = [
'"function"',
"this",
];
if (SUPPORT.bigint) VALUES = VALUES.concat([
"!0o644n",
"([3n][0] > 2)",
"(-42n).toString()",
"Number(0XDEADn << 16n | 0xbeefn)",
]);
var BINARY_OPS = [
" + ", // spaces needed to disambiguate with ++ cases (could otherwise cause syntax errors)