diff --git a/.gitattributes b/.gitattributes index fcadb2cf97..6313b56c57 100644 --- a/.gitattributes +++ b/.gitattributes @@ -1 +1 @@ -* text eol=lf +* text=auto eol=lf diff --git a/docs/parser.md b/docs/parser.md index 06c19be22a..fe35ee845c 100644 --- a/docs/parser.md +++ b/docs/parser.md @@ -34,7 +34,7 @@ mind. When in doubt, use `.parse()`. | Version | Changes | | --- | --- | -| `v7.21.0` | Added `allowNewTargetOutsideFunction` | +| `v7.21.0` | Added `allowNewTargetOutsideFunction` and `annexb` | | `v7.16.0` | Added `startColumn` | | `v7.15.0` | Added `attachComment` | | `v7.7.0` | Added `errorRecovery` | @@ -73,6 +73,8 @@ mind. When in doubt, use `.parse()`. - **attachComment**: By default, Babel attaches comments to adjacent AST nodes. When this option is set to `false`, comments are not attached. It can provide up to 30% performance improvement when the input code has _many_ comments. `@babel/eslint-parser` will set it for you. It is not recommended to use `attachComment: false` with Babel transform, as doing so removes all the comments in output code, and renders annotations such as `/* istanbul ignore next */` nonfunctional. +- **annexb**: By default, Babel parses JavaScript according to [ECMAScript's Annex B "_Additional ECMAScript Features for Web Browsers_"](https://tc39.es/ecma262/#sec-additional-ecmascript-features-for-web-browsers) syntax. When this option is set to `false`, Babel will parse syntax without the extensions specific to Annex B. + - **createParenthesizedExpressions**: By default, the parser sets `extra.parenthesized` on the expression nodes. When this option is set to `true`, `ParenthesizedExpression` AST nodes are created instead. - **errorRecovery**: By default, Babel always throws an error when it finds some invalid