Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Docs for allowNewTargetOutsideFunction #2724

Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
4 changes: 4 additions & 0 deletions docs/parser.md
Expand Up @@ -33,6 +33,7 @@ mind. When in doubt, use `.parse()`.
<summary>History</summary>
| Version | Changes |
| --- | --- |
| `v7.21.0` | Added `allowNewTargetOutsideFunction` |
| `v7.16.0` | Added `startColumn` |
| `v7.15.0` | Added `attachComment` |
| `v7.7.0` | Added `errorRecovery` |
Expand All @@ -50,6 +51,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