From ecebcd15f126162ba7adfb240d2cb0d891294d66 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nicol=C3=B2=20Ribaudo?= Date: Sat, 18 Feb 2023 16:22:21 +0100 Subject: [PATCH 1/2] Docs for `allowNewTargetOutsideFunction` --- docs/parser.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/docs/parser.md b/docs/parser.md index 8498973128..e51759f0f1 100644 --- a/docs/parser.md +++ b/docs/parser.md @@ -50,6 +50,9 @@ mind. When in doubt, use `.parse()`. top-level scope of scripts. This option is discouraged in favor of `topLevelAwait` plugin. +- **allowNewTargetOutsideFunction**: By default, `new.target` use is not + allowed outside of a function or class. Set this to `true` to accept such code. + - **allowReturnOutsideFunction**: By default, a return statement at the top level raises an error. Set this to `true` to accept such code. From 3c73796bfdc881efce995c964aef9ab85d48668c Mon Sep 17 00:00:00 2001 From: liuxingbaoyu <30521560+liuxingbaoyu@users.noreply.github.com> Date: Sat, 18 Feb 2023 23:57:18 +0800 Subject: [PATCH 2/2] History --- docs/parser.md | 1 + 1 file changed, 1 insertion(+) diff --git a/docs/parser.md b/docs/parser.md index e51759f0f1..0446e4fa9d 100644 --- a/docs/parser.md +++ b/docs/parser.md @@ -33,6 +33,7 @@ mind. When in doubt, use `.parse()`. History | Version | Changes | | --- | --- | +| `v7.21.0` | Added `allowNewTargetOutsideFunction` | | `v7.16.0` | Added `startColumn` | | `v7.15.0` | Added `attachComment` | | `v7.7.0` | Added `errorRecovery` |