You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Imported from the tarball published on npm
(https://registry.npmjs.org/acorn/-/acorn-5.7.2.tgz).
Update to emcaScript version 10 in order to get support for
binding-less catch statements.
Also needed to parse node.js lib API in #22405.
PR-URL: #22488
Reviewed-By: Refael Ackermann <refack@gmail.com>
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
Reviewed-By: John-David Dalton <john.david.dalton@gmail.com>
Reviewed-By: Tiancheng "Timothy" Gu <timothygu99@gmail.com>
Reviewed-By: Bryan English <bryan@bryanenglish.com>
Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com>
@@ -28,10 +28,13 @@ The easiest way to install acorn is with [`npm`][npm].
28
28
npm install acorn
29
29
```
30
30
31
-
Alternately, download the source.
31
+
Alternately, you can download the source and build acorn yourself:
32
32
33
33
```sh
34
-
git clone https://github.com/ternjs/acorn.git
34
+
git clone https://github.com/acornjs/acorn.git
35
+
cd acorn
36
+
npm install
37
+
npm run build
35
38
```
36
39
37
40
## Components
@@ -63,7 +66,7 @@ object referring to that same position.
63
66
[estree]: https://github.com/estree/estree
64
67
65
68
-**ecmaVersion**: Indicates the ECMAScript version to parse. Must be
66
-
either 3, 5, 6 (2015), 7 (2016), 8 (2017), or 9 (2018, partial
69
+
either 3, 5, 6 (2015), 7 (2016), 8 (2017), 9 (2018) or 10 (2019, partial
67
70
support). This influences support for strict mode, the set of
68
71
reserved words, and support for new syntax features. Default is 7.
69
72
@@ -97,6 +100,8 @@ object referring to that same position.
97
100
declarations can only appear at a program's top level. Setting this
98
101
option to `true` allows them anywhere where a statement is allowed.
99
102
103
+
-**allowAwaitOutsideFunction**: By default, `await` expressions can only appear inside `async` functions. Setting this option to `true` allows to have top-level `await` expressions. They are still not allowed in non-`async` functions, though.
104
+
100
105
-**allowHashBang**: When this is enabled (off by default), if the
101
106
code starts with the characters `#!` (as in a shellscript), the
102
107
first line will be treated as a comment.
@@ -351,7 +356,7 @@ The `bin/acorn` utility can be used to parse a file from the command
351
356
line. It accepts as arguments its input file and the following
352
357
options:
353
358
354
-
-`--ecma3|--ecma5|--ecma6|--ecma7|--ecma8|--ecma9`: Sets the ECMAScript version
359
+
-`--ecma3|--ecma5|--ecma6|--ecma7|--ecma8|--ecma9|--ecma10`: Sets the ECMAScript version
355
360
to parse. Default is version 7.
356
361
357
362
-`--module`: Sets the parsing mode to `"module"`. Is set to `"script"` otherwise.
-[`acorn-objj`](https://www.npmjs.com/package/acorn-objj): [Objective-J](http://www.cappuccino-project.org/learn/objective-j.html) language parser built as Acorn plugin
450
-
-[`acorn-object-rest-spread`](https://github.com/victor-homyakov/acorn-object-rest-spread) Parse [Object Rest/Spread Properties proposal](https://github.com/tc39/proposal-object-rest-spread), works with latest Acorn version (5.0.3)
451
-
-[`acorn-static-class-property-initializer`](https://github.com/victor-homyakov/acorn-static-class-property-initializer) Partial support for static class properties from [ES Class Fields & Static Properties Proposal](https://github.com/tc39/proposal-class-public-fields) to support static property initializers in [React components written as ES6+ classes](https://babeljs.io/blog/2015/06/07/react-on-es6-plus)
451
+
-[`acorn-objj`](https://github.com/cappuccino/acorn-objj): [Objective-J](http://www.cappuccino-project.org/learn/objective-j.html) language parser built as Acorn plugin
452
452
453
+
Plugins for ECMAScript proposals:
454
+
455
+
-[`acorn-stage3`](https://github.com/acornjs/acorn-stage3): Parse most stage 3 proposals, bundling:
-[`acorn-static-class-property-initializer`](https://github.com/victor-homyakov/acorn-static-class-property-initializer): Partial support for static class properties from [ES Class Fields & Static Properties Proposal](https://github.com/tc39/proposal-class-public-fields) to support static property initializers in [React components written as ES6+ classes](https://babeljs.io/blog/2015/06/07/react-on-es6-plus)
0 commit comments