Skip to content

Commit

Permalink
Docs for allowNewTargetOutsideFunction (#2724)
Browse files Browse the repository at this point in the history
Co-authored-by: liuxingbaoyu <30521560+liuxingbaoyu@users.noreply.github.com>
  • Loading branch information
nicolo-ribaudo and liuxingbaoyu committed Feb 20, 2023
1 parent 3465952 commit 47812e7
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions docs/parser.md
Expand Up @@ -34,6 +34,7 @@ mind. When in doubt, use `.parse()`.

| Version | Changes |
| --- | --- |
| `v7.21.0` | Added `allowNewTargetOutsideFunction` |
| `v7.16.0` | Added `startColumn` |
| `v7.15.0` | Added `attachComment` |
| `v7.7.0` | Added `errorRecovery` |
Expand All @@ -51,6 +52,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.
Expand Down

0 comments on commit 47812e7

Please sign in to comment.