From d2bd0d1c1c0ca5d837aeec5f7253a84bc8f333e2 Mon Sep 17 00:00:00 2001 From: "Alex Lam S.L" Date: Mon, 6 Jun 2022 04:52:01 +0100 Subject: [PATCH] support top-level `await` (#5487) --- README.md | 20 ++++++++++++++------ lib/parse.js | 5 ++++- test/ufuzz/index.js | 6 ++++-- 3 files changed, 22 insertions(+), 9 deletions(-) diff --git a/README.md b/README.md index 6c58aa95..5c450fd7 100644 --- a/README.md +++ b/README.md @@ -519,7 +519,8 @@ if (result.error) throw result.error; Pass an object to specify custom [mangle property options](#mangle-properties-options). - `module` (default: `false`) — set to `true` if you wish to process input as - ES module, i.e. implicit `"use strict";` alongside with `toplevel` enabled. + ES module, i.e. implicit `"use strict";` and support for top-level `await`, + alongside with `toplevel` enabled. - `nameCache` (default: `null`) — pass an empty object `{}` or a previously used `nameCache` object if you wish to cache mangled variable and @@ -632,7 +633,13 @@ to be `false` and all symbol names will be omitted. - `bare_returns` (default: `false`) — support top level `return` statements -- `html5_comments` (default: `true`) +- `expression` (default: `false`) — parse as a single expression, e.g. JSON + +- `html5_comments` (default: `true`) — process HTML comment as workaround for + browsers which do not recognise `