parse import.meta correctly (#4836)

This commit is contained in:
Alex Lam S.L
2021-04-02 21:31:29 +01:00
committed by GitHub
parent e755d01a0b
commit cf38b52afa
4 changed files with 21 additions and 3 deletions

View File

@@ -204,12 +204,18 @@ var VALUES = [
'"function"',
"this",
];
VALUES = VALUES.concat(VALUES);
VALUES = VALUES.concat(VALUES);
if (SUPPORT.bigint) VALUES = VALUES.concat([
"(!0o644n)",
"([3n][0] > 2)",
"(-42n).toString()",
"Number(0XDEADn << 16n | 0xbeefn)",
]);
VALUES = VALUES.concat(VALUES);
VALUES = VALUES.concat(VALUES);
VALUES = VALUES.concat(VALUES);
VALUES.push("import.meta");
var BINARY_OPS = [
" + ", // spaces needed to disambiguate with ++ cases (could otherwise cause syntax errors)