support #__PURE__ in ESTree (#4879)

This commit is contained in:
Alex Lam S.L
2021-04-28 21:13:42 +01:00
committed by GitHub
parent a06e20304b
commit d576495e5a
7 changed files with 88 additions and 19 deletions

View File

@@ -1456,7 +1456,7 @@ function OutputStream(options) {
parent = output.parent(level++);
if (parent instanceof AST_Call && parent.expression === node) return;
} while (parent instanceof AST_PropAccess && parent.expression === node);
output.print("/*" + self.pure + "*/");
output.print(typeof self.pure == "string" ? "/*" + self.pure + "*/" : "/*@__PURE__*/");
}
function print_call_args(self, output) {
if (self.expression instanceof AST_Call || self.expression instanceof AST_Lambda) {