deps: update acorn to 6.0.7
acorn and acorn-walk are now published as two different packages. Put them both in subdirectories of `deps/acorn`. Adapt the REPL's recoverable error detection to use the new API for extending acorn parsers. PR-URL: https://github.com/nodejs/node/pull/25844 Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
This commit is contained in:
parent
39171d755d
commit
582c12260e
77
deps/acorn/AUTHORS
vendored
77
deps/acorn/AUTHORS
vendored
@ -1,77 +0,0 @@
|
|||||||
List of Acorn contributors. Updated before every release.
|
|
||||||
|
|
||||||
Adrian Heine
|
|
||||||
Adrian Rakovsky
|
|
||||||
Alistair Braidwood
|
|
||||||
Amila Welihinda
|
|
||||||
Andres Suarez
|
|
||||||
Angelo
|
|
||||||
Aparajita Fishman
|
|
||||||
Arian Stolwijk
|
|
||||||
Artem Govorov
|
|
||||||
Boopesh Mahendran
|
|
||||||
Bradley Heinz
|
|
||||||
Brandon Mills
|
|
||||||
Charles Hughes
|
|
||||||
Charmander
|
|
||||||
Chris McKnight
|
|
||||||
Conrad Irwin
|
|
||||||
Daniel Tschinder
|
|
||||||
David Bonnet
|
|
||||||
Domenico Matteo
|
|
||||||
ehmicky
|
|
||||||
Eugene Obrezkov
|
|
||||||
Felix Maier
|
|
||||||
Forbes Lindesay
|
|
||||||
Gilad Peleg
|
|
||||||
impinball
|
|
||||||
Ingvar Stepanyan
|
|
||||||
Jackson Ray Hamilton
|
|
||||||
Jesse McCarthy
|
|
||||||
Jiaxing Wang
|
|
||||||
Joel Kemp
|
|
||||||
Johannes Herr
|
|
||||||
John-David Dalton
|
|
||||||
Jordan Klassen
|
|
||||||
Jürg Lehni
|
|
||||||
Kai Cataldo
|
|
||||||
keeyipchan
|
|
||||||
Keheliya Gallaba
|
|
||||||
Kevin Irish
|
|
||||||
Kevin Kwok
|
|
||||||
krator
|
|
||||||
laosb
|
|
||||||
Marek
|
|
||||||
Marijn Haverbeke
|
|
||||||
Martin Carlberg
|
|
||||||
Mat Garcia
|
|
||||||
Mathias Bynens
|
|
||||||
Mathieu 'p01' Henri
|
|
||||||
Matthew Bastien
|
|
||||||
Max Schaefer
|
|
||||||
Max Zerzouri
|
|
||||||
Mihai Bazon
|
|
||||||
Mike Rennie
|
|
||||||
naoh
|
|
||||||
Nicholas C. Zakas
|
|
||||||
Nick Fitzgerald
|
|
||||||
Olivier Thomann
|
|
||||||
Oskar Schöldström
|
|
||||||
Paul Harper
|
|
||||||
Peter Rust
|
|
||||||
PlNG
|
|
||||||
Prayag Verma
|
|
||||||
ReadmeCritic
|
|
||||||
r-e-d
|
|
||||||
Richard Gibson
|
|
||||||
Rich Harris
|
|
||||||
Sebastian McKenzie
|
|
||||||
Shahar Soel
|
|
||||||
Sheel Bedi
|
|
||||||
Simen Bekkhus
|
|
||||||
Teddy Katz
|
|
||||||
Timothy Gu
|
|
||||||
Toru Nagashima
|
|
||||||
Victor Homyakov
|
|
||||||
Wexpo Lyu
|
|
||||||
zsjforcn
|
|
467
deps/acorn/README.md
vendored
467
deps/acorn/README.md
vendored
@ -1,467 +0,0 @@
|
|||||||
# Acorn
|
|
||||||
|
|
||||||
[](https://travis-ci.org/acornjs/acorn)
|
|
||||||
[](https://www.npmjs.com/package/acorn)
|
|
||||||
[](https://cdnjs.com/libraries/acorn)
|
|
||||||
[Author funding status: ](https://marijnhaverbeke.nl/fund/)
|
|
||||||
|
|
||||||
A tiny, fast JavaScript parser, written completely in JavaScript.
|
|
||||||
|
|
||||||
## Community
|
|
||||||
|
|
||||||
Acorn is open source software released under an
|
|
||||||
[MIT license](https://github.com/acornjs/acorn/blob/master/LICENSE).
|
|
||||||
|
|
||||||
You are welcome to
|
|
||||||
[report bugs](https://github.com/acornjs/acorn/issues) or create pull
|
|
||||||
requests on [github](https://github.com/acornjs/acorn). For questions
|
|
||||||
and discussion, please use the
|
|
||||||
[Tern discussion forum](https://discuss.ternjs.net).
|
|
||||||
|
|
||||||
## Installation
|
|
||||||
|
|
||||||
The easiest way to install acorn is with [`npm`][npm].
|
|
||||||
|
|
||||||
[npm]: https://www.npmjs.com/
|
|
||||||
|
|
||||||
```sh
|
|
||||||
npm install acorn
|
|
||||||
```
|
|
||||||
|
|
||||||
Alternately, you can download the source and build acorn yourself:
|
|
||||||
|
|
||||||
```sh
|
|
||||||
git clone https://github.com/acornjs/acorn.git
|
|
||||||
cd acorn
|
|
||||||
npm install
|
|
||||||
npm run build
|
|
||||||
```
|
|
||||||
|
|
||||||
## Components
|
|
||||||
|
|
||||||
When run in a CommonJS (node.js) or AMD environment, exported values
|
|
||||||
appear in the interfaces exposed by the individual files, as usual.
|
|
||||||
When loaded in the browser (Acorn works in any JS-enabled browser more
|
|
||||||
recent than IE5) without any kind of module management, a single
|
|
||||||
global object `acorn` will be defined, and all the exported properties
|
|
||||||
will be added to that.
|
|
||||||
|
|
||||||
### Main parser
|
|
||||||
|
|
||||||
This is implemented in `dist/acorn.js`, and is what you get when you
|
|
||||||
`require("acorn")` in node.js.
|
|
||||||
|
|
||||||
**parse**`(input, options)` is used to parse a JavaScript program.
|
|
||||||
The `input` parameter is a string, `options` can be undefined or an
|
|
||||||
object setting some of the options listed below. The return value will
|
|
||||||
be an abstract syntax tree object as specified by the
|
|
||||||
[ESTree spec][estree].
|
|
||||||
|
|
||||||
When encountering a syntax error, the parser will raise a
|
|
||||||
`SyntaxError` object with a meaningful message. The error object will
|
|
||||||
have a `pos` property that indicates the character offset at which the
|
|
||||||
error occurred, and a `loc` object that contains a `{line, column}`
|
|
||||||
object referring to that same position.
|
|
||||||
|
|
||||||
[estree]: https://github.com/estree/estree
|
|
||||||
|
|
||||||
- **ecmaVersion**: Indicates the ECMAScript version to parse. Must be
|
|
||||||
either 3, 5, 6 (2015), 7 (2016), 8 (2017), 9 (2018) or 10 (2019, partial
|
|
||||||
support). This influences support for strict mode, the set of
|
|
||||||
reserved words, and support for new syntax features. Default is 7.
|
|
||||||
|
|
||||||
**NOTE**: Only 'stage 4' (finalized) ECMAScript features are being
|
|
||||||
implemented by Acorn.
|
|
||||||
|
|
||||||
- **sourceType**: Indicate the mode the code should be parsed in. Can be
|
|
||||||
either `"script"` or `"module"`. This influences global strict mode
|
|
||||||
and parsing of `import` and `export` declarations.
|
|
||||||
|
|
||||||
- **onInsertedSemicolon**: If given a callback, that callback will be
|
|
||||||
called whenever a missing semicolon is inserted by the parser. The
|
|
||||||
callback will be given the character offset of the point where the
|
|
||||||
semicolon is inserted as argument, and if `locations` is on, also a
|
|
||||||
`{line, column}` object representing this position.
|
|
||||||
|
|
||||||
- **onTrailingComma**: Like `onInsertedSemicolon`, but for trailing
|
|
||||||
commas.
|
|
||||||
|
|
||||||
- **allowReserved**: If `false`, using a reserved word will generate
|
|
||||||
an error. Defaults to `true` for `ecmaVersion` 3, `false` for higher
|
|
||||||
versions. When given the value `"never"`, reserved words and
|
|
||||||
keywords can also not be used as property names (as in Internet
|
|
||||||
Explorer's old parser).
|
|
||||||
|
|
||||||
- **allowReturnOutsideFunction**: By default, a return statement at
|
|
||||||
the top level raises an error. Set this to `true` to accept such
|
|
||||||
code.
|
|
||||||
|
|
||||||
- **allowImportExportEverywhere**: By default, `import` and `export`
|
|
||||||
declarations can only appear at a program's top level. Setting this
|
|
||||||
option to `true` allows them anywhere where a statement is allowed.
|
|
||||||
|
|
||||||
- **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.
|
|
||||||
|
|
||||||
- **allowHashBang**: When this is enabled (off by default), if the
|
|
||||||
code starts with the characters `#!` (as in a shellscript), the
|
|
||||||
first line will be treated as a comment.
|
|
||||||
|
|
||||||
- **locations**: When `true`, each node has a `loc` object attached
|
|
||||||
with `start` and `end` subobjects, each of which contains the
|
|
||||||
one-based line and zero-based column numbers in `{line, column}`
|
|
||||||
form. Default is `false`.
|
|
||||||
|
|
||||||
- **onToken**: If a function is passed for this option, each found
|
|
||||||
token will be passed in same format as tokens returned from
|
|
||||||
`tokenizer().getToken()`.
|
|
||||||
|
|
||||||
If array is passed, each found token is pushed to it.
|
|
||||||
|
|
||||||
Note that you are not allowed to call the parser from the
|
|
||||||
callback—that will corrupt its internal state.
|
|
||||||
|
|
||||||
- **onComment**: If a function is passed for this option, whenever a
|
|
||||||
comment is encountered the function will be called with the
|
|
||||||
following parameters:
|
|
||||||
|
|
||||||
- `block`: `true` if the comment is a block comment, false if it
|
|
||||||
is a line comment.
|
|
||||||
- `text`: The content of the comment.
|
|
||||||
- `start`: Character offset of the start of the comment.
|
|
||||||
- `end`: Character offset of the end of the comment.
|
|
||||||
|
|
||||||
When the `locations` options is on, the `{line, column}` locations
|
|
||||||
of the comment’s start and end are passed as two additional
|
|
||||||
parameters.
|
|
||||||
|
|
||||||
If array is passed for this option, each found comment is pushed
|
|
||||||
to it as object in Esprima format:
|
|
||||||
|
|
||||||
```javascript
|
|
||||||
{
|
|
||||||
"type": "Line" | "Block",
|
|
||||||
"value": "comment text",
|
|
||||||
"start": Number,
|
|
||||||
"end": Number,
|
|
||||||
// If `locations` option is on:
|
|
||||||
"loc": {
|
|
||||||
"start": {line: Number, column: Number}
|
|
||||||
"end": {line: Number, column: Number}
|
|
||||||
},
|
|
||||||
// If `ranges` option is on:
|
|
||||||
"range": [Number, Number]
|
|
||||||
}
|
|
||||||
```
|
|
||||||
|
|
||||||
Note that you are not allowed to call the parser from the
|
|
||||||
callback—that will corrupt its internal state.
|
|
||||||
|
|
||||||
- **ranges**: Nodes have their start and end characters offsets
|
|
||||||
recorded in `start` and `end` properties (directly on the node,
|
|
||||||
rather than the `loc` object, which holds line/column data. To also
|
|
||||||
add a [semi-standardized][range] `range` property holding a
|
|
||||||
`[start, end]` array with the same numbers, set the `ranges` option
|
|
||||||
to `true`.
|
|
||||||
|
|
||||||
- **program**: It is possible to parse multiple files into a single
|
|
||||||
AST by passing the tree produced by parsing the first file as the
|
|
||||||
`program` option in subsequent parses. This will add the toplevel
|
|
||||||
forms of the parsed file to the "Program" (top) node of an existing
|
|
||||||
parse tree.
|
|
||||||
|
|
||||||
- **sourceFile**: When the `locations` option is `true`, you can pass
|
|
||||||
this option to add a `source` attribute in every node’s `loc`
|
|
||||||
object. Note that the contents of this option are not examined or
|
|
||||||
processed in any way; you are free to use whatever format you
|
|
||||||
choose.
|
|
||||||
|
|
||||||
- **directSourceFile**: Like `sourceFile`, but a `sourceFile` property
|
|
||||||
will be added (regardless of the `location` option) directly to the
|
|
||||||
nodes, rather than the `loc` object.
|
|
||||||
|
|
||||||
- **preserveParens**: If this option is `true`, parenthesized expressions
|
|
||||||
are represented by (non-standard) `ParenthesizedExpression` nodes
|
|
||||||
that have a single `expression` property containing the expression
|
|
||||||
inside parentheses.
|
|
||||||
|
|
||||||
[range]: https://bugzilla.mozilla.org/show_bug.cgi?id=745678
|
|
||||||
|
|
||||||
**parseExpressionAt**`(input, offset, options)` will parse a single
|
|
||||||
expression in a string, and return its AST. It will not complain if
|
|
||||||
there is more of the string left after the expression.
|
|
||||||
|
|
||||||
**getLineInfo**`(input, offset)` can be used to get a `{line,
|
|
||||||
column}` object for a given program string and character offset.
|
|
||||||
|
|
||||||
**tokenizer**`(input, options)` returns an object with a `getToken`
|
|
||||||
method that can be called repeatedly to get the next token, a `{start,
|
|
||||||
end, type, value}` object (with added `loc` property when the
|
|
||||||
`locations` option is enabled and `range` property when the `ranges`
|
|
||||||
option is enabled). When the token's type is `tokTypes.eof`, you
|
|
||||||
should stop calling the method, since it will keep returning that same
|
|
||||||
token forever.
|
|
||||||
|
|
||||||
In ES6 environment, returned result can be used as any other
|
|
||||||
protocol-compliant iterable:
|
|
||||||
|
|
||||||
```javascript
|
|
||||||
for (let token of acorn.tokenizer(str)) {
|
|
||||||
// iterate over the tokens
|
|
||||||
}
|
|
||||||
|
|
||||||
// transform code to array of tokens:
|
|
||||||
var tokens = [...acorn.tokenizer(str)];
|
|
||||||
```
|
|
||||||
|
|
||||||
**tokTypes** holds an object mapping names to the token type objects
|
|
||||||
that end up in the `type` properties of tokens.
|
|
||||||
|
|
||||||
#### Note on using with [Escodegen][escodegen]
|
|
||||||
|
|
||||||
Escodegen supports generating comments from AST, attached in
|
|
||||||
Esprima-specific format. In order to simulate same format in
|
|
||||||
Acorn, consider following example:
|
|
||||||
|
|
||||||
```javascript
|
|
||||||
var comments = [], tokens = [];
|
|
||||||
|
|
||||||
var ast = acorn.parse('var x = 42; // answer', {
|
|
||||||
// collect ranges for each node
|
|
||||||
ranges: true,
|
|
||||||
// collect comments in Esprima's format
|
|
||||||
onComment: comments,
|
|
||||||
// collect token ranges
|
|
||||||
onToken: tokens
|
|
||||||
});
|
|
||||||
|
|
||||||
// attach comments using collected information
|
|
||||||
escodegen.attachComments(ast, comments, tokens);
|
|
||||||
|
|
||||||
// generate code
|
|
||||||
console.log(escodegen.generate(ast, {comment: true}));
|
|
||||||
// > 'var x = 42; // answer'
|
|
||||||
```
|
|
||||||
|
|
||||||
[escodegen]: https://github.com/estools/escodegen
|
|
||||||
|
|
||||||
### dist/acorn_loose.js ###
|
|
||||||
|
|
||||||
This file implements an error-tolerant parser. It exposes a single
|
|
||||||
function. The loose parser is accessible in node.js via `require("acorn/dist/acorn_loose")`.
|
|
||||||
|
|
||||||
**parse_dammit**`(input, options)` takes the same arguments and
|
|
||||||
returns the same syntax tree as the `parse` function in `acorn.js`,
|
|
||||||
but never raises an error, and will do its best to parse syntactically
|
|
||||||
invalid code in as meaningful a way as it can. It'll insert identifier
|
|
||||||
nodes with name `"✖"` as placeholders in places where it can't make
|
|
||||||
sense of the input. Depends on `acorn.js`, because it uses the same
|
|
||||||
tokenizer.
|
|
||||||
|
|
||||||
### dist/walk.js ###
|
|
||||||
|
|
||||||
Implements an abstract syntax tree walker. Will store its interface in
|
|
||||||
`acorn.walk` when loaded without a module system.
|
|
||||||
|
|
||||||
**simple**`(node, visitors, base, state)` does a 'simple' walk over
|
|
||||||
a tree. `node` should be the AST node to walk, and `visitors` an
|
|
||||||
object with properties whose names correspond to node types in the
|
|
||||||
[ESTree spec][estree]. The properties should contain functions
|
|
||||||
that will be called with the node object and, if applicable the state
|
|
||||||
at that point. The last two arguments are optional. `base` is a walker
|
|
||||||
algorithm, and `state` is a start state. The default walker will
|
|
||||||
simply visit all statements and expressions and not produce a
|
|
||||||
meaningful state. (An example of a use of state is to track scope at
|
|
||||||
each point in the tree.)
|
|
||||||
|
|
||||||
```js
|
|
||||||
const acorn = require("acorn")
|
|
||||||
const walk = require("acorn/dist/walk")
|
|
||||||
|
|
||||||
walk.simple(acorn.parse("let x = 10"), {
|
|
||||||
Literal(node) {
|
|
||||||
console.log(`Found a literal: ${node.value}`)
|
|
||||||
}
|
|
||||||
})
|
|
||||||
```
|
|
||||||
|
|
||||||
**ancestor**`(node, visitors, base, state)` does a 'simple' walk over
|
|
||||||
a tree, building up an array of ancestor nodes (including the current node)
|
|
||||||
and passing the array to the callbacks as a third parameter.
|
|
||||||
|
|
||||||
```js
|
|
||||||
const acorn = require("acorn")
|
|
||||||
const walk = require("acorn/dist/walk")
|
|
||||||
|
|
||||||
walk.ancestor(acorn.parse("foo('hi')"), {
|
|
||||||
Literal(_, ancestors) {
|
|
||||||
console.log("This literal's ancestors are:",
|
|
||||||
ancestors.map(n => n.type))
|
|
||||||
}
|
|
||||||
})
|
|
||||||
```
|
|
||||||
|
|
||||||
**recursive**`(node, state, functions, base)` does a 'recursive'
|
|
||||||
walk, where the walker functions are responsible for continuing the
|
|
||||||
walk on the child nodes of their target node. `state` is the start
|
|
||||||
state, and `functions` should contain an object that maps node types
|
|
||||||
to walker functions. Such functions are called with `(node, state, c)`
|
|
||||||
arguments, and can cause the walk to continue on a sub-node by calling
|
|
||||||
the `c` argument on it with `(node, state)` arguments. The optional
|
|
||||||
`base` argument provides the fallback walker functions for node types
|
|
||||||
that aren't handled in the `functions` object. If not given, the
|
|
||||||
default walkers will be used.
|
|
||||||
|
|
||||||
**make**`(functions, base)` builds a new walker object by using the
|
|
||||||
walker functions in `functions` and filling in the missing ones by
|
|
||||||
taking defaults from `base`.
|
|
||||||
|
|
||||||
**full**`(node, callback, base, state)` does a 'full'
|
|
||||||
walk over a tree, calling the callback with the arguments (node, state, type)
|
|
||||||
for each node
|
|
||||||
|
|
||||||
**fullAncestor**`(node, callback, base, state)` does a 'full' walk over
|
|
||||||
a tree, building up an array of ancestor nodes (including the current node)
|
|
||||||
and passing the array to the callbacks as a third parameter.
|
|
||||||
|
|
||||||
```js
|
|
||||||
const acorn = require("acorn")
|
|
||||||
const walk = require("acorn/dist/walk")
|
|
||||||
|
|
||||||
walk.full(acorn.parse("1 + 1"), node => {
|
|
||||||
console.log(`There's a ${node.type} node at ${node.ch}`)
|
|
||||||
})
|
|
||||||
```
|
|
||||||
|
|
||||||
**findNodeAt**`(node, start, end, test, base, state)` tries to
|
|
||||||
locate a node in a tree at the given start and/or end offsets, which
|
|
||||||
satisfies the predicate `test`. `start` and `end` can be either `null`
|
|
||||||
(as wildcard) or a number. `test` may be a string (indicating a node
|
|
||||||
type) or a function that takes `(nodeType, node)` arguments and
|
|
||||||
returns a boolean indicating whether this node is interesting. `base`
|
|
||||||
and `state` are optional, and can be used to specify a custom walker.
|
|
||||||
Nodes are tested from inner to outer, so if two nodes match the
|
|
||||||
boundaries, the inner one will be preferred.
|
|
||||||
|
|
||||||
**findNodeAround**`(node, pos, test, base, state)` is a lot like
|
|
||||||
`findNodeAt`, but will match any node that exists 'around' (spanning)
|
|
||||||
the given position.
|
|
||||||
|
|
||||||
**findNodeAfter**`(node, pos, test, base, state)` is similar to
|
|
||||||
`findNodeAround`, but will match all nodes *after* the given position
|
|
||||||
(testing outer nodes before inner nodes).
|
|
||||||
|
|
||||||
## Command line interface
|
|
||||||
|
|
||||||
The `bin/acorn` utility can be used to parse a file from the command
|
|
||||||
line. It accepts as arguments its input file and the following
|
|
||||||
options:
|
|
||||||
|
|
||||||
- `--ecma3|--ecma5|--ecma6|--ecma7|--ecma8|--ecma9|--ecma10`: Sets the ECMAScript version
|
|
||||||
to parse. Default is version 7.
|
|
||||||
|
|
||||||
- `--module`: Sets the parsing mode to `"module"`. Is set to `"script"` otherwise.
|
|
||||||
|
|
||||||
- `--locations`: Attaches a "loc" object to each node with "start" and
|
|
||||||
"end" subobjects, each of which contains the one-based line and
|
|
||||||
zero-based column numbers in `{line, column}` form.
|
|
||||||
|
|
||||||
- `--allow-hash-bang`: If the code starts with the characters #! (as in a shellscript), the first line will be treated as a comment.
|
|
||||||
|
|
||||||
- `--compact`: No whitespace is used in the AST output.
|
|
||||||
|
|
||||||
- `--silent`: Do not output the AST, just return the exit status.
|
|
||||||
|
|
||||||
- `--help`: Print the usage information and quit.
|
|
||||||
|
|
||||||
The utility spits out the syntax tree as JSON data.
|
|
||||||
|
|
||||||
## Build system
|
|
||||||
|
|
||||||
Acorn is written in ECMAScript 6, as a set of small modules, in the
|
|
||||||
project's `src` directory, and compiled down to bigger ECMAScript 3
|
|
||||||
files in `dist` using [Browserify](http://browserify.org) and
|
|
||||||
[Babel](http://babeljs.io/). If you are already using Babel, you can
|
|
||||||
consider including the modules directly.
|
|
||||||
|
|
||||||
The command-line test runner (`npm test`) uses the ES6 modules. The
|
|
||||||
browser-based test page (`test/index.html`) uses the compiled modules.
|
|
||||||
The `bin/build-acorn.js` script builds the latter from the former.
|
|
||||||
|
|
||||||
If you are working on Acorn, you'll probably want to try the code out
|
|
||||||
directly, without an intermediate build step. In your scripts, you can
|
|
||||||
register the Babel require shim like this:
|
|
||||||
|
|
||||||
require("babel-core/register")
|
|
||||||
|
|
||||||
That will allow you to directly `require` the ES6 modules.
|
|
||||||
|
|
||||||
## Plugins
|
|
||||||
|
|
||||||
Acorn is designed support allow plugins which, within reasonable
|
|
||||||
bounds, redefine the way the parser works. Plugins can add new token
|
|
||||||
types and new tokenizer contexts (if necessary), and extend methods in
|
|
||||||
the parser object. This is not a clean, elegant API—using it requires
|
|
||||||
an understanding of Acorn's internals, and plugins are likely to break
|
|
||||||
whenever those internals are significantly changed. But still, it is
|
|
||||||
_possible_, in this way, to create parsers for JavaScript dialects
|
|
||||||
without forking all of Acorn. And in principle it is even possible to
|
|
||||||
combine such plugins, so that if you have, for example, a plugin for
|
|
||||||
parsing types and a plugin for parsing JSX-style XML literals, you
|
|
||||||
could load them both and parse code with both JSX tags and types.
|
|
||||||
|
|
||||||
A plugin should register itself by adding a property to
|
|
||||||
`acorn.plugins`, which holds a function. Calling `acorn.parse`, a
|
|
||||||
`plugins` option can be passed, holding an object mapping plugin names
|
|
||||||
to configuration values (or just `true` for plugins that don't take
|
|
||||||
options). After the parser object has been created, the initialization
|
|
||||||
functions for the chosen plugins are called with `(parser,
|
|
||||||
configValue)` arguments. They are expected to use the `parser.extend`
|
|
||||||
method to extend parser methods. For example, the `readToken` method
|
|
||||||
could be extended like this:
|
|
||||||
|
|
||||||
```javascript
|
|
||||||
parser.extend("readToken", function(nextMethod) {
|
|
||||||
return function(code) {
|
|
||||||
console.log("Reading a token!")
|
|
||||||
return nextMethod.call(this, code)
|
|
||||||
}
|
|
||||||
})
|
|
||||||
```
|
|
||||||
|
|
||||||
The `nextMethod` argument passed to `extend`'s second argument is the
|
|
||||||
previous value of this method, and should usually be called through to
|
|
||||||
whenever the extended method does not handle the call itself.
|
|
||||||
|
|
||||||
Similarly, the loose parser allows plugins to register themselves via
|
|
||||||
`acorn.pluginsLoose`. The extension mechanism is the same as for the
|
|
||||||
normal parser:
|
|
||||||
|
|
||||||
```javascript
|
|
||||||
looseParser.extend("readToken", function(nextMethod) {
|
|
||||||
return function() {
|
|
||||||
console.log("Reading a token in the loose parser!")
|
|
||||||
return nextMethod.call(this)
|
|
||||||
}
|
|
||||||
})
|
|
||||||
```
|
|
||||||
|
|
||||||
### Existing plugins
|
|
||||||
|
|
||||||
- [`acorn-jsx`](https://github.com/RReverser/acorn-jsx): Parse [Facebook JSX syntax extensions](https://github.com/facebook/jsx)
|
|
||||||
- [`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
|
|
||||||
|
|
||||||
Plugins for ECMAScript proposals:
|
|
||||||
|
|
||||||
- [`acorn-stage3`](https://github.com/acornjs/acorn-stage3): Parse most stage 3 proposals, bundling:
|
|
||||||
- [`acorn-async-iteration`](https://github.com/acornjs/acorn-async-iteration): Parse [async iteration proposal](https://github.com/tc39/proposal-async-iteration)
|
|
||||||
- [`acorn-bigint`](https://github.com/acornjs/acorn-bigint): Parse [BigInt proposal](https://github.com/tc39/proposal-bigint)
|
|
||||||
- [`acorn-class-fields`](https://github.com/acornjs/acorn-class-fields): Parse [class fields proposal](https://github.com/tc39/proposal-class-fields)
|
|
||||||
- [`acorn-dynamic-import`](https://github.com/kesne/acorn-dynamic-import): Parse [import() proposal](https://github.com/tc39/proposal-dynamic-import)
|
|
||||||
- [`acorn-import-meta`](https://github.com/acornjs/acorn-import-meta): Parse [import.meta proposal](https://github.com/tc39/proposal-import-meta)
|
|
||||||
- [`acorn-numeric-separator`](https://github.com/acornjs/acorn-numeric-separator): Parse [numeric separator proposal](https://github.com/tc39/proposal-numeric-separator)
|
|
||||||
- [`acorn-optional-catch-binding`](https://github.com/acornjs/acorn-optional-catch-binding): Parse [optional catch binding proposal](https://github.com/tc39/proposal-optional-catch-binding)
|
|
||||||
- [`acorn-private-methods`](https://github.com/acornjs/acorn-private-methods): parse [private methods, getters and setters proposal](https://github.com/tc39/proposal-private-methods)
|
|
||||||
- [`acorn5-object-spread`](https://github.com/adrianheine/acorn5-object-spread): Parse [Object Rest/Spread Properties proposal](https://github.com/tc39/proposal-object-rest-spread)
|
|
||||||
- [`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)
|
|
||||||
- [`acorn-es7`](https://github.com/angelozerr/acorn-es7): Parse [decorator syntax proposal](https://github.com/wycats/javascript-decorators)
|
|
||||||
- [`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)
|
|
97
deps/acorn/acorn-walk/CHANGELOG.md
vendored
Normal file
97
deps/acorn/acorn-walk/CHANGELOG.md
vendored
Normal file
@ -0,0 +1,97 @@
|
|||||||
|
## 6.1.0 (2018-09-28)
|
||||||
|
|
||||||
|
### New features
|
||||||
|
|
||||||
|
The walker now walks `TemplateElement` nodes.
|
||||||
|
|
||||||
|
## 6.0.1 (2018-09-14)
|
||||||
|
|
||||||
|
### Bug fixes
|
||||||
|
|
||||||
|
Fix bad "main" field in package.json.
|
||||||
|
|
||||||
|
## 6.0.0 (2018-09-14)
|
||||||
|
|
||||||
|
### Breaking changes
|
||||||
|
|
||||||
|
This is now a separate package, `acorn-walk`, rather than part of the main `acorn` package.
|
||||||
|
|
||||||
|
The `ScopeBody` and `ScopeExpression` meta-node-types are no longer supported.
|
||||||
|
|
||||||
|
## 5.7.1 (2018-06-15)
|
||||||
|
|
||||||
|
### Bug fixes
|
||||||
|
|
||||||
|
Make sure the walker and bin files are rebuilt on release (the previous release didn't get the up-to-date versions).
|
||||||
|
|
||||||
|
## 5.7.0 (2018-06-15)
|
||||||
|
|
||||||
|
### Bug fixes
|
||||||
|
|
||||||
|
Fix crash in walker when walking a binding-less catch node.
|
||||||
|
|
||||||
|
## 5.6.2 (2018-06-05)
|
||||||
|
|
||||||
|
### Bug fixes
|
||||||
|
|
||||||
|
In the walker, go back to allowing the `baseVisitor` argument to be null to default to the default base everywhere.
|
||||||
|
|
||||||
|
## 5.6.1 (2018-06-01)
|
||||||
|
|
||||||
|
### Bug fixes
|
||||||
|
|
||||||
|
Fix regression when passing `null` as fourth argument to `walk.recursive`.
|
||||||
|
|
||||||
|
## 5.6.0 (2018-05-31)
|
||||||
|
|
||||||
|
### Bug fixes
|
||||||
|
|
||||||
|
Fix a bug in the walker that caused a crash when walking an object pattern spread.
|
||||||
|
|
||||||
|
## 5.5.1 (2018-03-06)
|
||||||
|
|
||||||
|
### Bug fixes
|
||||||
|
|
||||||
|
Fix regression in walker causing property values in object patterns to be walked as expressions.
|
||||||
|
|
||||||
|
## 5.5.0 (2018-02-27)
|
||||||
|
|
||||||
|
### Bug fixes
|
||||||
|
|
||||||
|
Support object spread in the AST walker.
|
||||||
|
|
||||||
|
## 5.4.1 (2018-02-02)
|
||||||
|
|
||||||
|
### Bug fixes
|
||||||
|
|
||||||
|
5.4.0 somehow accidentally included an old version of walk.js.
|
||||||
|
|
||||||
|
## 5.2.0 (2017-10-30)
|
||||||
|
|
||||||
|
### Bug fixes
|
||||||
|
|
||||||
|
The `full` and `fullAncestor` walkers no longer visit nodes multiple times.
|
||||||
|
|
||||||
|
## 5.1.0 (2017-07-05)
|
||||||
|
|
||||||
|
### New features
|
||||||
|
|
||||||
|
New walker functions `full` and `fullAncestor`.
|
||||||
|
|
||||||
|
## 3.2.0 (2016-06-07)
|
||||||
|
|
||||||
|
### New features
|
||||||
|
|
||||||
|
Make it possible to use `visit.ancestor` with a walk state.
|
||||||
|
|
||||||
|
## 3.1.0 (2016-04-18)
|
||||||
|
|
||||||
|
### New features
|
||||||
|
|
||||||
|
The walker now allows defining handlers for `CatchClause` nodes.
|
||||||
|
|
||||||
|
## 2.5.2 (2015-10-27)
|
||||||
|
|
||||||
|
### Fixes
|
||||||
|
|
||||||
|
Fix bug where the walker walked an exported `let` statement as an expression.
|
126
deps/acorn/acorn-walk/README.md
vendored
Normal file
126
deps/acorn/acorn-walk/README.md
vendored
Normal file
@ -0,0 +1,126 @@
|
|||||||
|
# Acorn AST walker
|
||||||
|
|
||||||
|
An abstract syntax tree walker for the
|
||||||
|
[ESTree](https://github.com/estree/estree) format.
|
||||||
|
|
||||||
|
## Community
|
||||||
|
|
||||||
|
Acorn is open source software released under an
|
||||||
|
[MIT license](https://github.com/acornjs/acorn/blob/master/LICENSE).
|
||||||
|
|
||||||
|
You are welcome to
|
||||||
|
[report bugs](https://github.com/acornjs/acorn/issues) or create pull
|
||||||
|
requests on [github](https://github.com/acornjs/acorn). For questions
|
||||||
|
and discussion, please use the
|
||||||
|
[Tern discussion forum](https://discuss.ternjs.net).
|
||||||
|
|
||||||
|
## Installation
|
||||||
|
|
||||||
|
The easiest way to install acorn is from [`npm`](https://www.npmjs.com/):
|
||||||
|
|
||||||
|
```sh
|
||||||
|
npm install acorn-walk
|
||||||
|
```
|
||||||
|
|
||||||
|
Alternately, you can download the source and build acorn yourself:
|
||||||
|
|
||||||
|
```sh
|
||||||
|
git clone https://github.com/acornjs/acorn.git
|
||||||
|
cd acorn
|
||||||
|
npm install
|
||||||
|
```
|
||||||
|
|
||||||
|
## Interface
|
||||||
|
|
||||||
|
An algorithm for recursing through a syntax tree is stored as an
|
||||||
|
object, with a property for each tree node type holding a function
|
||||||
|
that will recurse through such a node. There are several ways to run
|
||||||
|
such a walker.
|
||||||
|
|
||||||
|
**simple**`(node, visitors, base, state)` does a 'simple' walk over a
|
||||||
|
tree. `node` should be the AST node to walk, and `visitors` an object
|
||||||
|
with properties whose names correspond to node types in the [ESTree
|
||||||
|
spec](https://github.com/estree/estree). The properties should contain
|
||||||
|
functions that will be called with the node object and, if applicable
|
||||||
|
the state at that point. The last two arguments are optional. `base`
|
||||||
|
is a walker algorithm, and `state` is a start state. The default
|
||||||
|
walker will simply visit all statements and expressions and not
|
||||||
|
produce a meaningful state. (An example of a use of state is to track
|
||||||
|
scope at each point in the tree.)
|
||||||
|
|
||||||
|
```js
|
||||||
|
const acorn = require("acorn")
|
||||||
|
const walk = require("acorn-walk")
|
||||||
|
|
||||||
|
walk.simple(acorn.parse("let x = 10"), {
|
||||||
|
Literal(node) {
|
||||||
|
console.log(`Found a literal: ${node.value}`)
|
||||||
|
}
|
||||||
|
})
|
||||||
|
```
|
||||||
|
|
||||||
|
**ancestor**`(node, visitors, base, state)` does a 'simple' walk over
|
||||||
|
a tree, building up an array of ancestor nodes (including the current node)
|
||||||
|
and passing the array to the callbacks as a third parameter.
|
||||||
|
|
||||||
|
```js
|
||||||
|
const acorn = require("acorn")
|
||||||
|
const walk = require("acorn-walk")
|
||||||
|
|
||||||
|
walk.ancestor(acorn.parse("foo('hi')"), {
|
||||||
|
Literal(_, ancestors) {
|
||||||
|
console.log("This literal's ancestors are:", ancestors.map(n => n.type))
|
||||||
|
}
|
||||||
|
})
|
||||||
|
```
|
||||||
|
|
||||||
|
**recursive**`(node, state, functions, base)` does a 'recursive'
|
||||||
|
walk, where the walker functions are responsible for continuing the
|
||||||
|
walk on the child nodes of their target node. `state` is the start
|
||||||
|
state, and `functions` should contain an object that maps node types
|
||||||
|
to walker functions. Such functions are called with `(node, state, c)`
|
||||||
|
arguments, and can cause the walk to continue on a sub-node by calling
|
||||||
|
the `c` argument on it with `(node, state)` arguments. The optional
|
||||||
|
`base` argument provides the fallback walker functions for node types
|
||||||
|
that aren't handled in the `functions` object. If not given, the
|
||||||
|
default walkers will be used.
|
||||||
|
|
||||||
|
**make**`(functions, base)` builds a new walker object by using the
|
||||||
|
walker functions in `functions` and filling in the missing ones by
|
||||||
|
taking defaults from `base`.
|
||||||
|
|
||||||
|
**full**`(node, callback, base, state)` does a 'full' walk over a
|
||||||
|
tree, calling the callback with the arguments (node, state, type) for
|
||||||
|
each node
|
||||||
|
|
||||||
|
**fullAncestor**`(node, callback, base, state)` does a 'full' walk
|
||||||
|
over a tree, building up an array of ancestor nodes (including the
|
||||||
|
current node) and passing the array to the callbacks as a third
|
||||||
|
parameter.
|
||||||
|
|
||||||
|
```js
|
||||||
|
const acorn = require("acorn")
|
||||||
|
const walk = require("acorn-walk")
|
||||||
|
|
||||||
|
walk.full(acorn.parse("1 + 1"), node => {
|
||||||
|
console.log(`There's a ${node.type} node at ${node.ch}`)
|
||||||
|
})
|
||||||
|
```
|
||||||
|
|
||||||
|
**findNodeAt**`(node, start, end, test, base, state)` tries to locate
|
||||||
|
a node in a tree at the given start and/or end offsets, which
|
||||||
|
satisfies the predicate `test`. `start` and `end` can be either `null`
|
||||||
|
(as wildcard) or a number. `test` may be a string (indicating a node
|
||||||
|
type) or a function that takes `(nodeType, node)` arguments and
|
||||||
|
returns a boolean indicating whether this node is interesting. `base`
|
||||||
|
and `state` are optional, and can be used to specify a custom walker.
|
||||||
|
Nodes are tested from inner to outer, so if two nodes match the
|
||||||
|
boundaries, the inner one will be preferred.
|
||||||
|
|
||||||
|
**findNodeAround**`(node, pos, test, base, state)` is a lot like
|
||||||
|
`findNodeAt`, but will match any node that exists 'around' (spanning)
|
||||||
|
the given position.
|
||||||
|
|
||||||
|
**findNodeAfter**`(node, pos, test, base, state)` is similar to
|
||||||
|
`findNodeAround`, but will match all nodes *after* the given position
|
||||||
|
(testing outer nodes before inner nodes).
|
@ -15,8 +15,8 @@
|
|||||||
// });
|
// });
|
||||||
//
|
//
|
||||||
// to do something with all expressions. All Parser API node types
|
// to do something with all expressions. All Parser API node types
|
||||||
// can be used to identify node types, as well as Expression,
|
// can be used to identify node types, as well as Expression and
|
||||||
// Statement, and ScopeBody, which denote categories of nodes.
|
// Statement, which denote categories of nodes.
|
||||||
//
|
//
|
||||||
// The base argument can be used to pass a custom (recursive)
|
// The base argument can be used to pass a custom (recursive)
|
||||||
// walker, and state can be used to give this walked an initial
|
// walker, and state can be used to give this walked an initial
|
||||||
@ -245,7 +245,7 @@ base.TryStatement = function (node, st, c) {
|
|||||||
};
|
};
|
||||||
base.CatchClause = function (node, st, c) {
|
base.CatchClause = function (node, st, c) {
|
||||||
if (node.param) { c(node.param, st, "Pattern"); }
|
if (node.param) { c(node.param, st, "Pattern"); }
|
||||||
c(node.body, st, "ScopeBody");
|
c(node.body, st, "Statement");
|
||||||
};
|
};
|
||||||
base.WhileStatement = base.DoWhileStatement = function (node, st, c) {
|
base.WhileStatement = base.DoWhileStatement = function (node, st, c) {
|
||||||
c(node.test, st, "Expression");
|
c(node.test, st, "Expression");
|
||||||
@ -290,12 +290,8 @@ base.Function = function (node, st, c) {
|
|||||||
|
|
||||||
c(param, st, "Pattern");
|
c(param, st, "Pattern");
|
||||||
}
|
}
|
||||||
c(node.body, st, node.expression ? "ScopeExpression" : "ScopeBody");
|
c(node.body, st, node.expression ? "Expression" : "Statement");
|
||||||
};
|
};
|
||||||
// FIXME drop these node types in next major version
|
|
||||||
// (They are awkward, and in ES6 every block can be a scope.)
|
|
||||||
base.ScopeBody = function (node, st, c) { return c(node, st, "Statement"); };
|
|
||||||
base.ScopeExpression = function (node, st, c) { return c(node, st, "Expression"); };
|
|
||||||
|
|
||||||
base.Pattern = function (node, st, c) {
|
base.Pattern = function (node, st, c) {
|
||||||
if (node.type === "Identifier")
|
if (node.type === "Identifier")
|
||||||
@ -346,7 +342,7 @@ base.ObjectExpression = function (node, st, c) {
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
base.FunctionExpression = base.ArrowFunctionExpression = base.FunctionDeclaration;
|
base.FunctionExpression = base.ArrowFunctionExpression = base.FunctionDeclaration;
|
||||||
base.SequenceExpression = base.TemplateLiteral = function (node, st, c) {
|
base.SequenceExpression = function (node, st, c) {
|
||||||
for (var i = 0, list = node.expressions; i < list.length; i += 1)
|
for (var i = 0, list = node.expressions; i < list.length; i += 1)
|
||||||
{
|
{
|
||||||
var expr = list[i];
|
var expr = list[i];
|
||||||
@ -354,6 +350,22 @@ base.SequenceExpression = base.TemplateLiteral = function (node, st, c) {
|
|||||||
c(expr, st, "Expression");
|
c(expr, st, "Expression");
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
base.TemplateLiteral = function (node, st, c) {
|
||||||
|
for (var i = 0, list = node.quasis; i < list.length; i += 1)
|
||||||
|
{
|
||||||
|
var quasi = list[i];
|
||||||
|
|
||||||
|
c(quasi, st);
|
||||||
|
}
|
||||||
|
|
||||||
|
for (var i$1 = 0, list$1 = node.expressions; i$1 < list$1.length; i$1 += 1)
|
||||||
|
{
|
||||||
|
var expr = list$1[i$1];
|
||||||
|
|
||||||
|
c(expr, st, "Expression");
|
||||||
|
}
|
||||||
|
};
|
||||||
|
base.TemplateElement = ignore;
|
||||||
base.UnaryExpression = base.UpdateExpression = function (node, st, c) {
|
base.UnaryExpression = base.UpdateExpression = function (node, st, c) {
|
||||||
c(node.argument, st, "Expression");
|
c(node.argument, st, "Expression");
|
||||||
};
|
};
|
||||||
@ -441,3 +453,4 @@ exports.base = base;
|
|||||||
Object.defineProperty(exports, '__esModule', { value: true });
|
Object.defineProperty(exports, '__esModule', { value: true });
|
||||||
|
|
||||||
})));
|
})));
|
||||||
|
//# sourceMappingURL=walk.js.map
|
1
deps/acorn/acorn-walk/dist/walk.js.map
vendored
Normal file
1
deps/acorn/acorn-walk/dist/walk.js.map
vendored
Normal file
File diff suppressed because one or more lines are too long
@ -9,8 +9,8 @@
|
|||||||
// });
|
// });
|
||||||
//
|
//
|
||||||
// to do something with all expressions. All Parser API node types
|
// to do something with all expressions. All Parser API node types
|
||||||
// can be used to identify node types, as well as Expression,
|
// can be used to identify node types, as well as Expression and
|
||||||
// Statement, and ScopeBody, which denote categories of nodes.
|
// Statement, which denote categories of nodes.
|
||||||
//
|
//
|
||||||
// The base argument can be used to pass a custom (recursive)
|
// The base argument can be used to pass a custom (recursive)
|
||||||
// walker, and state can be used to give this walked an initial
|
// walker, and state can be used to give this walked an initial
|
||||||
@ -239,7 +239,7 @@ base.TryStatement = function (node, st, c) {
|
|||||||
};
|
};
|
||||||
base.CatchClause = function (node, st, c) {
|
base.CatchClause = function (node, st, c) {
|
||||||
if (node.param) { c(node.param, st, "Pattern"); }
|
if (node.param) { c(node.param, st, "Pattern"); }
|
||||||
c(node.body, st, "ScopeBody");
|
c(node.body, st, "Statement");
|
||||||
};
|
};
|
||||||
base.WhileStatement = base.DoWhileStatement = function (node, st, c) {
|
base.WhileStatement = base.DoWhileStatement = function (node, st, c) {
|
||||||
c(node.test, st, "Expression");
|
c(node.test, st, "Expression");
|
||||||
@ -284,12 +284,8 @@ base.Function = function (node, st, c) {
|
|||||||
|
|
||||||
c(param, st, "Pattern");
|
c(param, st, "Pattern");
|
||||||
}
|
}
|
||||||
c(node.body, st, node.expression ? "ScopeExpression" : "ScopeBody");
|
c(node.body, st, node.expression ? "Expression" : "Statement");
|
||||||
};
|
};
|
||||||
// FIXME drop these node types in next major version
|
|
||||||
// (They are awkward, and in ES6 every block can be a scope.)
|
|
||||||
base.ScopeBody = function (node, st, c) { return c(node, st, "Statement"); };
|
|
||||||
base.ScopeExpression = function (node, st, c) { return c(node, st, "Expression"); };
|
|
||||||
|
|
||||||
base.Pattern = function (node, st, c) {
|
base.Pattern = function (node, st, c) {
|
||||||
if (node.type === "Identifier")
|
if (node.type === "Identifier")
|
||||||
@ -340,7 +336,7 @@ base.ObjectExpression = function (node, st, c) {
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
base.FunctionExpression = base.ArrowFunctionExpression = base.FunctionDeclaration;
|
base.FunctionExpression = base.ArrowFunctionExpression = base.FunctionDeclaration;
|
||||||
base.SequenceExpression = base.TemplateLiteral = function (node, st, c) {
|
base.SequenceExpression = function (node, st, c) {
|
||||||
for (var i = 0, list = node.expressions; i < list.length; i += 1)
|
for (var i = 0, list = node.expressions; i < list.length; i += 1)
|
||||||
{
|
{
|
||||||
var expr = list[i];
|
var expr = list[i];
|
||||||
@ -348,6 +344,22 @@ base.SequenceExpression = base.TemplateLiteral = function (node, st, c) {
|
|||||||
c(expr, st, "Expression");
|
c(expr, st, "Expression");
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
base.TemplateLiteral = function (node, st, c) {
|
||||||
|
for (var i = 0, list = node.quasis; i < list.length; i += 1)
|
||||||
|
{
|
||||||
|
var quasi = list[i];
|
||||||
|
|
||||||
|
c(quasi, st);
|
||||||
|
}
|
||||||
|
|
||||||
|
for (var i$1 = 0, list$1 = node.expressions; i$1 < list$1.length; i$1 += 1)
|
||||||
|
{
|
||||||
|
var expr = list$1[i$1];
|
||||||
|
|
||||||
|
c(expr, st, "Expression");
|
||||||
|
}
|
||||||
|
};
|
||||||
|
base.TemplateElement = ignore;
|
||||||
base.UnaryExpression = base.UpdateExpression = function (node, st, c) {
|
base.UnaryExpression = base.UpdateExpression = function (node, st, c) {
|
||||||
c(node.argument, st, "Expression");
|
c(node.argument, st, "Expression");
|
||||||
};
|
};
|
||||||
@ -421,3 +433,4 @@ base.MethodDefinition = base.Property = function (node, st, c) {
|
|||||||
};
|
};
|
||||||
|
|
||||||
export { simple, ancestor, recursive, full, fullAncestor, findNodeAt, findNodeAround, findNodeAfter, findNodeBefore, make, base };
|
export { simple, ancestor, recursive, full, fullAncestor, findNodeAt, findNodeAround, findNodeAfter, findNodeBefore, make, base };
|
||||||
|
//# sourceMappingURL=walk.mjs.map
|
1
deps/acorn/acorn-walk/dist/walk.mjs.map
vendored
Normal file
1
deps/acorn/acorn-walk/dist/walk.mjs.map
vendored
Normal file
File diff suppressed because one or more lines are too long
33
deps/acorn/acorn-walk/package.json
vendored
Normal file
33
deps/acorn/acorn-walk/package.json
vendored
Normal file
@ -0,0 +1,33 @@
|
|||||||
|
{
|
||||||
|
"name": "acorn-walk",
|
||||||
|
"description": "ECMAScript (ESTree) AST walker",
|
||||||
|
"homepage": "https://github.com/acornjs/acorn",
|
||||||
|
"main": "dist/walk.js",
|
||||||
|
"module": "dist/walk.mjs",
|
||||||
|
"version": "6.1.1",
|
||||||
|
"engines": {"node": ">=0.4.0"},
|
||||||
|
"maintainers": [
|
||||||
|
{
|
||||||
|
"name": "Marijn Haverbeke",
|
||||||
|
"email": "marijnh@gmail.com",
|
||||||
|
"web": "https://marijnhaverbeke.nl"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "Ingvar Stepanyan",
|
||||||
|
"email": "me@rreverser.com",
|
||||||
|
"web": "https://rreverser.com/"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "Adrian Heine",
|
||||||
|
"web": "http://adrianheine.de"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"repository": {
|
||||||
|
"type": "git",
|
||||||
|
"url": "https://github.com/acornjs/acorn.git"
|
||||||
|
},
|
||||||
|
"scripts": {
|
||||||
|
"prepare": "cd ..; npm run build:walk"
|
||||||
|
},
|
||||||
|
"license": "MIT"
|
||||||
|
}
|
@ -1,3 +1,105 @@
|
|||||||
|
## 6.0.7 (2019-02-04)
|
||||||
|
|
||||||
|
### Bug fixes
|
||||||
|
|
||||||
|
Check that exported bindings are defined.
|
||||||
|
|
||||||
|
Don't treat `\u180e` as a whitespace character.
|
||||||
|
|
||||||
|
Check for duplicate parameter names in methods.
|
||||||
|
|
||||||
|
Don't allow shorthand properties when they are generators or async methods.
|
||||||
|
|
||||||
|
Forbid binding `await` in async arrow function's parameter list.
|
||||||
|
|
||||||
|
## 6.0.6 (2019-01-30)
|
||||||
|
|
||||||
|
### Bug fixes
|
||||||
|
|
||||||
|
The content of class declarations and expressions is now always parsed in strict mode.
|
||||||
|
|
||||||
|
Don't allow `let` or `const` to bind the variable name `let`.
|
||||||
|
|
||||||
|
Treat class declarations as lexical.
|
||||||
|
|
||||||
|
Don't allow a generator function declaration as the sole body of an `if` or `else`.
|
||||||
|
|
||||||
|
Ignore `"use strict"` when after an empty statement.
|
||||||
|
|
||||||
|
Allow string line continuations with special line terminator characters.
|
||||||
|
|
||||||
|
Treat `for` bodies as part of the `for` scope when checking for conflicting bindings.
|
||||||
|
|
||||||
|
Fix bug with parsing `yield` in a `for` loop initializer.
|
||||||
|
|
||||||
|
Implement special cases around scope checking for functions.
|
||||||
|
|
||||||
|
## 6.0.5 (2019-01-02)
|
||||||
|
|
||||||
|
### Bug fixes
|
||||||
|
|
||||||
|
Fix TypeScript type for `Parser.extend` and add `allowAwaitOutsideFunction` to options type.
|
||||||
|
|
||||||
|
Don't treat `let` as a keyword when the next token is `{` on the next line.
|
||||||
|
|
||||||
|
Fix bug that broke checking for parentheses around an object pattern in a destructuring assignment when `preserveParens` was on.
|
||||||
|
|
||||||
|
## 6.0.4 (2018-11-05)
|
||||||
|
|
||||||
|
### Bug fixes
|
||||||
|
|
||||||
|
Further improvements to tokenizing regular expressions in corner cases.
|
||||||
|
|
||||||
|
## 6.0.3 (2018-11-04)
|
||||||
|
|
||||||
|
### Bug fixes
|
||||||
|
|
||||||
|
Fix bug in tokenizing an expression-less return followed by a function followed by a regular expression.
|
||||||
|
|
||||||
|
Remove stray symlink in the package tarball.
|
||||||
|
|
||||||
|
## 6.0.2 (2018-09-26)
|
||||||
|
|
||||||
|
### Bug fixes
|
||||||
|
|
||||||
|
Fix bug where default expressions could fail to parse inside an object destructuring assignment expression.
|
||||||
|
|
||||||
|
## 6.0.1 (2018-09-14)
|
||||||
|
|
||||||
|
### Bug fixes
|
||||||
|
|
||||||
|
Fix wrong value in `version` export.
|
||||||
|
|
||||||
|
## 6.0.0 (2018-09-14)
|
||||||
|
|
||||||
|
### Bug fixes
|
||||||
|
|
||||||
|
Better handle variable-redefinition checks for catch bindings and functions directly under if statements.
|
||||||
|
|
||||||
|
Forbid `new.target` in top-level arrow functions.
|
||||||
|
|
||||||
|
Fix issue with parsing a regexp after `yield` in some contexts.
|
||||||
|
|
||||||
|
### New features
|
||||||
|
|
||||||
|
The package now comes with TypeScript definitions.
|
||||||
|
|
||||||
|
### Breaking changes
|
||||||
|
|
||||||
|
The default value of the `ecmaVersion` option is now 9 (2018).
|
||||||
|
|
||||||
|
Plugins work differently, and will have to be rewritten to work with this version.
|
||||||
|
|
||||||
|
The loose parser and walker have been moved into separate packages (`acorn-loose` and `acorn-walk`).
|
||||||
|
|
||||||
|
## 5.7.3 (2018-09-10)
|
||||||
|
|
||||||
|
### Bug fixes
|
||||||
|
|
||||||
|
Fix failure to tokenize regexps after expressions like `x.of`.
|
||||||
|
|
||||||
|
Better error message for unterminated template literals.
|
||||||
|
|
||||||
## 5.7.2 (2018-08-24)
|
## 5.7.2 (2018-08-24)
|
||||||
|
|
||||||
### Bug fixes
|
### Bug fixes
|
||||||
@ -8,40 +110,14 @@ Treat function declarations at the top level of modules like let bindings.
|
|||||||
|
|
||||||
Don't allow async function declarations as the only statement under a label.
|
Don't allow async function declarations as the only statement under a label.
|
||||||
|
|
||||||
## 5.7.1 (2018-06-15)
|
|
||||||
|
|
||||||
### Bug fixes
|
|
||||||
|
|
||||||
Make sure the walker and bin files are rebuilt on release (the previous release didn't get the up-to-date versions).
|
|
||||||
|
|
||||||
## 5.7.0 (2018-06-15)
|
## 5.7.0 (2018-06-15)
|
||||||
|
|
||||||
### Bug fixes
|
|
||||||
|
|
||||||
Fix crash in walker when walking a binding-less catch node.
|
|
||||||
|
|
||||||
### New features
|
### New features
|
||||||
|
|
||||||
Upgraded to Unicode 11.
|
Upgraded to Unicode 11.
|
||||||
|
|
||||||
## 5.6.2 (2018-06-05)
|
|
||||||
|
|
||||||
### Bug fixes
|
|
||||||
|
|
||||||
In the walker, go back to allowing the `baseVisitor` argument to be null to default to the default base everywhere.
|
|
||||||
|
|
||||||
## 5.6.1 (2018-06-01)
|
|
||||||
|
|
||||||
### Bug fixes
|
|
||||||
|
|
||||||
Fix regression when passing `null` as fourth argument to `walk.recursive`.
|
|
||||||
|
|
||||||
## 5.6.0 (2018-05-31)
|
## 5.6.0 (2018-05-31)
|
||||||
|
|
||||||
### Bug fixes
|
|
||||||
|
|
||||||
Fix a bug in the walker that caused a crash when walking an object pattern spread.
|
|
||||||
|
|
||||||
### New features
|
### New features
|
||||||
|
|
||||||
Allow U+2028 and U+2029 in string when ECMAVersion >= 10.
|
Allow U+2028 and U+2029 in string when ECMAVersion >= 10.
|
||||||
@ -66,28 +142,16 @@ A republish of the code in 5.5.1 in an attempt to solve an issue with the file t
|
|||||||
|
|
||||||
### Bug fixes
|
### Bug fixes
|
||||||
|
|
||||||
Fix regression in walker causing property values in object patterns to be walked as expressions.
|
|
||||||
|
|
||||||
Fix misleading error message for octal escapes in template strings.
|
Fix misleading error message for octal escapes in template strings.
|
||||||
|
|
||||||
## 5.5.0 (2018-02-27)
|
## 5.5.0 (2018-02-27)
|
||||||
|
|
||||||
### Bug fixes
|
|
||||||
|
|
||||||
Support object spread in the AST walker.
|
|
||||||
|
|
||||||
### New features
|
### New features
|
||||||
|
|
||||||
The identifier character categorization is now based on Unicode version 10.
|
The identifier character categorization is now based on Unicode version 10.
|
||||||
|
|
||||||
Acorn will now validate the content of regular expressions, including new ES9 features.
|
Acorn will now validate the content of regular expressions, including new ES9 features.
|
||||||
|
|
||||||
## 5.4.1 (2018-02-02)
|
|
||||||
|
|
||||||
### Bug fixes
|
|
||||||
|
|
||||||
5.4.0 somehow accidentally included an old version of walk.js.
|
|
||||||
|
|
||||||
## 5.4.0 (2018-02-01)
|
## 5.4.0 (2018-02-01)
|
||||||
|
|
||||||
### Bug fixes
|
### Bug fixes
|
||||||
@ -138,8 +202,6 @@ Fix token context tracking for `class` and `function` in property-name position.
|
|||||||
|
|
||||||
Make sure `%*` isn't parsed as a valid operator.
|
Make sure `%*` isn't parsed as a valid operator.
|
||||||
|
|
||||||
The `full` and `fullAncestor` walkers no longer visit nodes multiple times.
|
|
||||||
|
|
||||||
Allow shorthand properties `get` and `set` to be followed by default values.
|
Allow shorthand properties `get` and `set` to be followed by default values.
|
||||||
|
|
||||||
Disallow `super` when not in callee or object position.
|
Disallow `super` when not in callee or object position.
|
||||||
@ -176,14 +238,10 @@ Don't error when `yield` is used as a property name.
|
|||||||
|
|
||||||
Allow `async` as a shorthand object property.
|
Allow `async` as a shorthand object property.
|
||||||
|
|
||||||
Make the ES module version of the loose parser actually work.
|
|
||||||
|
|
||||||
### New features
|
### New features
|
||||||
|
|
||||||
Implement the [template literal revision proposal](https://github.com/tc39/proposal-template-literal-revision) for ES9.
|
Implement the [template literal revision proposal](https://github.com/tc39/proposal-template-literal-revision) for ES9.
|
||||||
|
|
||||||
New walker functions `full` and `fullAncestor`.
|
|
||||||
|
|
||||||
## 5.0.3 (2017-04-01)
|
## 5.0.3 (2017-04-01)
|
||||||
|
|
||||||
### Bug fixes
|
### Bug fixes
|
||||||
@ -222,26 +280,21 @@ Allow all forms of member expressions to be parenthesized as lvalue.
|
|||||||
|
|
||||||
### Bug fixes
|
### Bug fixes
|
||||||
|
|
||||||
Don't expect semicolons after default-exported functions or classes,
|
Don't expect semicolons after default-exported functions or classes, even when they are expressions.
|
||||||
even when they are expressions.
|
|
||||||
|
|
||||||
Check for use of `'use strict'` directives in non-simple parameter
|
Check for use of `'use strict'` directives in non-simple parameter functions, even when already in strict mode.
|
||||||
functions, even when already in strict mode.
|
|
||||||
|
|
||||||
## 4.0.9 (2017-02-06)
|
## 4.0.9 (2017-02-06)
|
||||||
|
|
||||||
### Bug fixes
|
### Bug fixes
|
||||||
|
|
||||||
Fix incorrect error raised for parenthesized simple assignment
|
Fix incorrect error raised for parenthesized simple assignment targets, so that `(x) = 1` parses again.
|
||||||
targets, so that `(x) = 1` parses again.
|
|
||||||
|
|
||||||
## 4.0.8 (2017-02-03)
|
## 4.0.8 (2017-02-03)
|
||||||
|
|
||||||
### Bug fixes
|
### Bug fixes
|
||||||
|
|
||||||
Solve spurious parenthesized pattern errors by temporarily erring on
|
Solve spurious parenthesized pattern errors by temporarily erring on the side of accepting programs that our delayed errors don't handle correctly yet.
|
||||||
the side of accepting programs that our delayed errors don't handle
|
|
||||||
correctly yet.
|
|
||||||
|
|
||||||
## 4.0.7 (2017-02-02)
|
## 4.0.7 (2017-02-02)
|
||||||
|
|
||||||
@ -249,16 +302,13 @@ correctly yet.
|
|||||||
|
|
||||||
Accept invalidly rejected code like `(x).y = 2` again.
|
Accept invalidly rejected code like `(x).y = 2` again.
|
||||||
|
|
||||||
Don't raise an error when a function _inside_ strict code has a
|
Don't raise an error when a function _inside_ strict code has a non-simple parameter list.
|
||||||
non-simple parameter list.
|
|
||||||
|
|
||||||
## 4.0.6 (2017-02-02)
|
## 4.0.6 (2017-02-02)
|
||||||
|
|
||||||
### Bug fixes
|
### Bug fixes
|
||||||
|
|
||||||
Fix exponential behavior (manifesting itself as a complete hang for
|
Fix exponential behavior (manifesting itself as a complete hang for even relatively small source files) introduced by the new 'use strict' check.
|
||||||
even relatively small source files) introduced by the new 'use strict'
|
|
||||||
check.
|
|
||||||
|
|
||||||
## 4.0.5 (2017-02-02)
|
## 4.0.5 (2017-02-02)
|
||||||
|
|
||||||
@ -280,8 +330,6 @@ Disallow labeled declarations.
|
|||||||
|
|
||||||
### Bug fixes
|
### Bug fixes
|
||||||
|
|
||||||
Fix issue with loading acorn_loose.js with an AMD loader.
|
|
||||||
|
|
||||||
Fix crash when `export` was followed by a keyword that can't be
|
Fix crash when `export` was followed by a keyword that can't be
|
||||||
exported.
|
exported.
|
||||||
|
|
||||||
@ -289,8 +337,7 @@ exported.
|
|||||||
|
|
||||||
### Bug fixes
|
### Bug fixes
|
||||||
|
|
||||||
Allow regular function declarations inside single-statement `if`
|
Allow regular function declarations inside single-statement `if` branches in loose mode. Forbid them entirely in strict mode.
|
||||||
branches in loose mode. Forbid them entirely in strict mode.
|
|
||||||
|
|
||||||
Properly parse properties named `async` in ES2017 mode.
|
Properly parse properties named `async` in ES2017 mode.
|
||||||
|
|
||||||
@ -302,8 +349,7 @@ Fix bug where reserved words were broken in ES2017 mode.
|
|||||||
|
|
||||||
Don't ignore period or 'e' characters after octal numbers.
|
Don't ignore period or 'e' characters after octal numbers.
|
||||||
|
|
||||||
Fix broken parsing for call expressions in default parameter values
|
Fix broken parsing for call expressions in default parameter values of arrow functions.
|
||||||
of arrow functions.
|
|
||||||
|
|
||||||
## 4.0.1 (2016-08-08)
|
## 4.0.1 (2016-08-08)
|
||||||
|
|
||||||
@ -317,8 +363,7 @@ Fix false positives in duplicated export name errors.
|
|||||||
|
|
||||||
The default `ecmaVersion` option value is now 7.
|
The default `ecmaVersion` option value is now 7.
|
||||||
|
|
||||||
A number of internal method signatures changed, so plugins might need
|
A number of internal method signatures changed, so plugins might need to be updated.
|
||||||
to be updated.
|
|
||||||
|
|
||||||
### Bug fixes
|
### Bug fixes
|
||||||
|
|
||||||
@ -326,8 +371,7 @@ The parser now raises errors on duplicated export names.
|
|||||||
|
|
||||||
`arguments` and `eval` can now be used in shorthand properties.
|
`arguments` and `eval` can now be used in shorthand properties.
|
||||||
|
|
||||||
Duplicate parameter names in non-simple argument lists now always
|
Duplicate parameter names in non-simple argument lists now always produce an error.
|
||||||
produce an error.
|
|
||||||
|
|
||||||
### New features
|
### New features
|
||||||
|
|
||||||
@ -336,8 +380,7 @@ The `ecmaVersion` option now also accepts year-style version numbers
|
|||||||
|
|
||||||
Support for `async`/`await` syntax when `ecmaVersion` is >= 8.
|
Support for `async`/`await` syntax when `ecmaVersion` is >= 8.
|
||||||
|
|
||||||
Support for trailing commas in call expressions when `ecmaVersion`
|
Support for trailing commas in call expressions when `ecmaVersion` is >= 8.
|
||||||
is >= 8.
|
|
||||||
|
|
||||||
## 3.3.0 (2016-07-25)
|
## 3.3.0 (2016-07-25)
|
||||||
|
|
||||||
@ -349,8 +392,7 @@ Fix parser crash when parsing an array pattern with a hole.
|
|||||||
|
|
||||||
### New features
|
### New features
|
||||||
|
|
||||||
Implement check against complex argument lists in functions that
|
Implement check against complex argument lists in functions that enable strict mode in ES7.
|
||||||
enable strict mode in ES7.
|
|
||||||
|
|
||||||
## 3.2.0 (2016-06-07)
|
## 3.2.0 (2016-06-07)
|
||||||
|
|
||||||
@ -361,44 +403,29 @@ environment.
|
|||||||
|
|
||||||
Properly reject shorthand properties whose name is a keyword.
|
Properly reject shorthand properties whose name is a keyword.
|
||||||
|
|
||||||
Don't crash when the loose parser is called without options object.
|
|
||||||
|
|
||||||
### New features
|
### New features
|
||||||
|
|
||||||
Visitors created with `visit.make` now have their base as _prototype_,
|
Visitors created with `visit.make` now have their base as _prototype_, rather than copying properties into a fresh object.
|
||||||
rather than copying properties into a fresh object.
|
|
||||||
|
|
||||||
Make it possible to use `visit.ancestor` with a walk state.
|
|
||||||
|
|
||||||
## 3.1.0 (2016-04-18)
|
## 3.1.0 (2016-04-18)
|
||||||
|
|
||||||
### Bug fixes
|
### Bug fixes
|
||||||
|
|
||||||
Fix issue where the loose parser created invalid TemplateElement nodes
|
Properly tokenize the division operator directly after a function expression.
|
||||||
for unclosed template literals.
|
|
||||||
|
|
||||||
Properly tokenize the division operator directly after a function
|
|
||||||
expression.
|
|
||||||
|
|
||||||
Allow trailing comma in destructuring arrays.
|
Allow trailing comma in destructuring arrays.
|
||||||
|
|
||||||
### New features
|
|
||||||
|
|
||||||
The walker now allows defining handlers for `CatchClause` nodes.
|
|
||||||
|
|
||||||
## 3.0.4 (2016-02-25)
|
## 3.0.4 (2016-02-25)
|
||||||
|
|
||||||
### Fixes
|
### Fixes
|
||||||
|
|
||||||
Allow update expressions as left-hand-side of the ES7 exponential
|
Allow update expressions as left-hand-side of the ES7 exponential operator.
|
||||||
operator.
|
|
||||||
|
|
||||||
## 3.0.2 (2016-02-10)
|
## 3.0.2 (2016-02-10)
|
||||||
|
|
||||||
### Fixes
|
### Fixes
|
||||||
|
|
||||||
Fix bug that accidentally made `undefined` a reserved word when
|
Fix bug that accidentally made `undefined` a reserved word when parsing ES7.
|
||||||
parsing ES7.
|
|
||||||
|
|
||||||
## 3.0.0 (2016-02-10)
|
## 3.0.0 (2016-02-10)
|
||||||
|
|
||||||
@ -406,26 +433,21 @@ parsing ES7.
|
|||||||
|
|
||||||
The default value of the `ecmaVersion` option is now 6 (used to be 5).
|
The default value of the `ecmaVersion` option is now 6 (used to be 5).
|
||||||
|
|
||||||
Support for comprehension syntax (which was dropped from the draft
|
Support for comprehension syntax (which was dropped from the draft spec) has been removed.
|
||||||
spec) has been removed.
|
|
||||||
|
|
||||||
### Fixes
|
### Fixes
|
||||||
|
|
||||||
`let` and `yield` are now “contextual keywords”, meaning you can
|
`let` and `yield` are now “contextual keywords”, meaning you can mostly use them as identifiers in ES5 non-strict code.
|
||||||
mostly use them as identifiers in ES5 non-strict code.
|
|
||||||
|
|
||||||
A parenthesized class or function expression after `export default` is
|
A parenthesized class or function expression after `export default` is now parsed correctly.
|
||||||
now parsed correctly.
|
|
||||||
|
|
||||||
### New features
|
### New features
|
||||||
|
|
||||||
When `ecmaVersion` is set to 7, Acorn will parse the exponentiation
|
When `ecmaVersion` is set to 7, Acorn will parse the exponentiation operator (`**`).
|
||||||
operator (`**`).
|
|
||||||
|
|
||||||
The identifier character ranges are now based on Unicode 8.0.0.
|
The identifier character ranges are now based on Unicode 8.0.0.
|
||||||
|
|
||||||
Plugins can now override the `raiseRecoverable` method to override the
|
Plugins can now override the `raiseRecoverable` method to override the way non-critical errors are handled.
|
||||||
way non-critical errors are handled.
|
|
||||||
|
|
||||||
## 2.7.0 (2016-01-04)
|
## 2.7.0 (2016-01-04)
|
||||||
|
|
||||||
@ -433,25 +455,12 @@ way non-critical errors are handled.
|
|||||||
|
|
||||||
Stop allowing rest parameters in setters.
|
Stop allowing rest parameters in setters.
|
||||||
|
|
||||||
Make sure the loose parser always attaches a `local` property to
|
|
||||||
`ImportNamespaceSpecifier` nodes.
|
|
||||||
|
|
||||||
Disallow `y` rexexp flag in ES5.
|
Disallow `y` rexexp flag in ES5.
|
||||||
|
|
||||||
Disallow `\00` and `\000` escapes in strict mode.
|
Disallow `\00` and `\000` escapes in strict mode.
|
||||||
|
|
||||||
Raise an error when an import name is a reserved word.
|
Raise an error when an import name is a reserved word.
|
||||||
|
|
||||||
## 2.6.4 (2015-11-12)
|
|
||||||
|
|
||||||
### Fixes
|
|
||||||
|
|
||||||
Fix crash in loose parser when parsing invalid object pattern.
|
|
||||||
|
|
||||||
### New features
|
|
||||||
|
|
||||||
Support plugins in the loose parser.
|
|
||||||
|
|
||||||
## 2.6.2 (2015-11-10)
|
## 2.6.2 (2015-11-10)
|
||||||
|
|
||||||
### Fixes
|
### Fixes
|
||||||
@ -472,28 +481,17 @@ Forbid using a comma after a rest pattern in an array destructuring.
|
|||||||
|
|
||||||
Support parsing stdin in command-line tool.
|
Support parsing stdin in command-line tool.
|
||||||
|
|
||||||
## 2.5.2 (2015-10-27)
|
|
||||||
|
|
||||||
### Fixes
|
|
||||||
|
|
||||||
Fix bug where the walker walked an exported `let` statement as an
|
|
||||||
expression.
|
|
||||||
|
|
||||||
## 2.5.0 (2015-10-27)
|
## 2.5.0 (2015-10-27)
|
||||||
|
|
||||||
### Fixes
|
### Fixes
|
||||||
|
|
||||||
Fix tokenizer support in the command-line tool.
|
Fix tokenizer support in the command-line tool.
|
||||||
|
|
||||||
In the loose parser, don't allow non-string-literals as import
|
|
||||||
sources.
|
|
||||||
|
|
||||||
Stop allowing `new.target` outside of functions.
|
Stop allowing `new.target` outside of functions.
|
||||||
|
|
||||||
Remove legacy `guard` and `guardedHandler` properties from try nodes.
|
Remove legacy `guard` and `guardedHandler` properties from try nodes.
|
||||||
|
|
||||||
Stop allowing multiple `__proto__` properties on an object literal in
|
Stop allowing multiple `__proto__` properties on an object literal in strict mode.
|
||||||
strict mode.
|
|
||||||
|
|
||||||
Don't allow rest parameters to be non-identifier patterns.
|
Don't allow rest parameters to be non-identifier patterns.
|
||||||
|
|
19
deps/acorn/acorn/LICENSE
vendored
Normal file
19
deps/acorn/acorn/LICENSE
vendored
Normal file
@ -0,0 +1,19 @@
|
|||||||
|
Copyright (C) 2012-2018 by various contributors (see AUTHORS)
|
||||||
|
|
||||||
|
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||||
|
of this software and associated documentation files (the "Software"), to deal
|
||||||
|
in the Software without restriction, including without limitation the rights
|
||||||
|
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||||
|
copies of the Software, and to permit persons to whom the Software is
|
||||||
|
furnished to do so, subject to the following conditions:
|
||||||
|
|
||||||
|
The above copyright notice and this permission notice shall be included in
|
||||||
|
all copies or substantial portions of the Software.
|
||||||
|
|
||||||
|
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||||
|
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||||
|
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||||
|
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||||
|
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||||
|
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||||
|
THE SOFTWARE.
|
269
deps/acorn/acorn/README.md
vendored
Normal file
269
deps/acorn/acorn/README.md
vendored
Normal file
@ -0,0 +1,269 @@
|
|||||||
|
# Acorn
|
||||||
|
|
||||||
|
A tiny, fast JavaScript parser written in JavaScript.
|
||||||
|
|
||||||
|
## Community
|
||||||
|
|
||||||
|
Acorn is open source software released under an
|
||||||
|
[MIT license](https://github.com/acornjs/acorn/blob/master/acorn/LICENSE).
|
||||||
|
|
||||||
|
You are welcome to
|
||||||
|
[report bugs](https://github.com/acornjs/acorn/issues) or create pull
|
||||||
|
requests on [github](https://github.com/acornjs/acorn). For questions
|
||||||
|
and discussion, please use the
|
||||||
|
[Tern discussion forum](https://discuss.ternjs.net).
|
||||||
|
|
||||||
|
## Installation
|
||||||
|
|
||||||
|
The easiest way to install acorn is from [`npm`](https://www.npmjs.com/):
|
||||||
|
|
||||||
|
```sh
|
||||||
|
npm install acorn
|
||||||
|
```
|
||||||
|
|
||||||
|
Alternately, you can download the source and build acorn yourself:
|
||||||
|
|
||||||
|
```sh
|
||||||
|
git clone https://github.com/acornjs/acorn.git
|
||||||
|
cd acorn
|
||||||
|
npm install
|
||||||
|
```
|
||||||
|
|
||||||
|
## Interface
|
||||||
|
|
||||||
|
**parse**`(input, options)` is the main interface to the library. The
|
||||||
|
`input` parameter is a string, `options` can be undefined or an object
|
||||||
|
setting some of the options listed below. The return value will be an
|
||||||
|
abstract syntax tree object as specified by the [ESTree
|
||||||
|
spec](https://github.com/estree/estree).
|
||||||
|
|
||||||
|
```javascript
|
||||||
|
let acorn = require("acorn");
|
||||||
|
console.log(acorn.parse("1 + 1"));
|
||||||
|
```
|
||||||
|
|
||||||
|
When encountering a syntax error, the parser will raise a
|
||||||
|
`SyntaxError` object with a meaningful message. The error object will
|
||||||
|
have a `pos` property that indicates the string offset at which the
|
||||||
|
error occurred, and a `loc` object that contains a `{line, column}`
|
||||||
|
object referring to that same position.
|
||||||
|
|
||||||
|
Options can be provided by passing a second argument, which should be
|
||||||
|
an object containing any of these fields:
|
||||||
|
|
||||||
|
- **ecmaVersion**: Indicates the ECMAScript version to parse. Must be
|
||||||
|
either 3, 5, 6 (2015), 7 (2016), 8 (2017), 9 (2018) or 10 (2019, partial
|
||||||
|
support). This influences support for strict mode, the set of
|
||||||
|
reserved words, and support for new syntax features. Default is 7.
|
||||||
|
|
||||||
|
**NOTE**: Only 'stage 4' (finalized) ECMAScript features are being
|
||||||
|
implemented by Acorn. Other proposed new features can be implemented
|
||||||
|
through plugins.
|
||||||
|
|
||||||
|
- **sourceType**: Indicate the mode the code should be parsed in. Can be
|
||||||
|
either `"script"` or `"module"`. This influences global strict mode
|
||||||
|
and parsing of `import` and `export` declarations.
|
||||||
|
|
||||||
|
- **onInsertedSemicolon**: If given a callback, that callback will be
|
||||||
|
called whenever a missing semicolon is inserted by the parser. The
|
||||||
|
callback will be given the character offset of the point where the
|
||||||
|
semicolon is inserted as argument, and if `locations` is on, also a
|
||||||
|
`{line, column}` object representing this position.
|
||||||
|
|
||||||
|
- **onTrailingComma**: Like `onInsertedSemicolon`, but for trailing
|
||||||
|
commas.
|
||||||
|
|
||||||
|
- **allowReserved**: If `false`, using a reserved word will generate
|
||||||
|
an error. Defaults to `true` for `ecmaVersion` 3, `false` for higher
|
||||||
|
versions. When given the value `"never"`, reserved words and
|
||||||
|
keywords can also not be used as property names (as in Internet
|
||||||
|
Explorer's old parser).
|
||||||
|
|
||||||
|
- **allowReturnOutsideFunction**: By default, a return statement at
|
||||||
|
the top level raises an error. Set this to `true` to accept such
|
||||||
|
code.
|
||||||
|
|
||||||
|
- **allowImportExportEverywhere**: By default, `import` and `export`
|
||||||
|
declarations can only appear at a program's top level. Setting this
|
||||||
|
option to `true` allows them anywhere where a statement is allowed.
|
||||||
|
|
||||||
|
- **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.
|
||||||
|
|
||||||
|
- **allowHashBang**: When this is enabled (off by default), if the
|
||||||
|
code starts with the characters `#!` (as in a shellscript), the
|
||||||
|
first line will be treated as a comment.
|
||||||
|
|
||||||
|
- **locations**: When `true`, each node has a `loc` object attached
|
||||||
|
with `start` and `end` subobjects, each of which contains the
|
||||||
|
one-based line and zero-based column numbers in `{line, column}`
|
||||||
|
form. Default is `false`.
|
||||||
|
|
||||||
|
- **onToken**: If a function is passed for this option, each found
|
||||||
|
token will be passed in same format as tokens returned from
|
||||||
|
`tokenizer().getToken()`.
|
||||||
|
|
||||||
|
If array is passed, each found token is pushed to it.
|
||||||
|
|
||||||
|
Note that you are not allowed to call the parser from the
|
||||||
|
callback—that will corrupt its internal state.
|
||||||
|
|
||||||
|
- **onComment**: If a function is passed for this option, whenever a
|
||||||
|
comment is encountered the function will be called with the
|
||||||
|
following parameters:
|
||||||
|
|
||||||
|
- `block`: `true` if the comment is a block comment, false if it
|
||||||
|
is a line comment.
|
||||||
|
- `text`: The content of the comment.
|
||||||
|
- `start`: Character offset of the start of the comment.
|
||||||
|
- `end`: Character offset of the end of the comment.
|
||||||
|
|
||||||
|
When the `locations` options is on, the `{line, column}` locations
|
||||||
|
of the comment’s start and end are passed as two additional
|
||||||
|
parameters.
|
||||||
|
|
||||||
|
If array is passed for this option, each found comment is pushed
|
||||||
|
to it as object in Esprima format:
|
||||||
|
|
||||||
|
```javascript
|
||||||
|
{
|
||||||
|
"type": "Line" | "Block",
|
||||||
|
"value": "comment text",
|
||||||
|
"start": Number,
|
||||||
|
"end": Number,
|
||||||
|
// If `locations` option is on:
|
||||||
|
"loc": {
|
||||||
|
"start": {line: Number, column: Number}
|
||||||
|
"end": {line: Number, column: Number}
|
||||||
|
},
|
||||||
|
// If `ranges` option is on:
|
||||||
|
"range": [Number, Number]
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
Note that you are not allowed to call the parser from the
|
||||||
|
callback—that will corrupt its internal state.
|
||||||
|
|
||||||
|
- **ranges**: Nodes have their start and end characters offsets
|
||||||
|
recorded in `start` and `end` properties (directly on the node,
|
||||||
|
rather than the `loc` object, which holds line/column data. To also
|
||||||
|
add a
|
||||||
|
[semi-standardized](https://bugzilla.mozilla.org/show_bug.cgi?id=745678)
|
||||||
|
`range` property holding a `[start, end]` array with the same
|
||||||
|
numbers, set the `ranges` option to `true`.
|
||||||
|
|
||||||
|
- **program**: It is possible to parse multiple files into a single
|
||||||
|
AST by passing the tree produced by parsing the first file as the
|
||||||
|
`program` option in subsequent parses. This will add the toplevel
|
||||||
|
forms of the parsed file to the "Program" (top) node of an existing
|
||||||
|
parse tree.
|
||||||
|
|
||||||
|
- **sourceFile**: When the `locations` option is `true`, you can pass
|
||||||
|
this option to add a `source` attribute in every node’s `loc`
|
||||||
|
object. Note that the contents of this option are not examined or
|
||||||
|
processed in any way; you are free to use whatever format you
|
||||||
|
choose.
|
||||||
|
|
||||||
|
- **directSourceFile**: Like `sourceFile`, but a `sourceFile` property
|
||||||
|
will be added (regardless of the `location` option) directly to the
|
||||||
|
nodes, rather than the `loc` object.
|
||||||
|
|
||||||
|
- **preserveParens**: If this option is `true`, parenthesized expressions
|
||||||
|
are represented by (non-standard) `ParenthesizedExpression` nodes
|
||||||
|
that have a single `expression` property containing the expression
|
||||||
|
inside parentheses.
|
||||||
|
|
||||||
|
**parseExpressionAt**`(input, offset, options)` will parse a single
|
||||||
|
expression in a string, and return its AST. It will not complain if
|
||||||
|
there is more of the string left after the expression.
|
||||||
|
|
||||||
|
**tokenizer**`(input, options)` returns an object with a `getToken`
|
||||||
|
method that can be called repeatedly to get the next token, a `{start,
|
||||||
|
end, type, value}` object (with added `loc` property when the
|
||||||
|
`locations` option is enabled and `range` property when the `ranges`
|
||||||
|
option is enabled). When the token's type is `tokTypes.eof`, you
|
||||||
|
should stop calling the method, since it will keep returning that same
|
||||||
|
token forever.
|
||||||
|
|
||||||
|
In ES6 environment, returned result can be used as any other
|
||||||
|
protocol-compliant iterable:
|
||||||
|
|
||||||
|
```javascript
|
||||||
|
for (let token of acorn.tokenizer(str)) {
|
||||||
|
// iterate over the tokens
|
||||||
|
}
|
||||||
|
|
||||||
|
// transform code to array of tokens:
|
||||||
|
var tokens = [...acorn.tokenizer(str)];
|
||||||
|
```
|
||||||
|
|
||||||
|
**tokTypes** holds an object mapping names to the token type objects
|
||||||
|
that end up in the `type` properties of tokens.
|
||||||
|
|
||||||
|
**getLineInfo**`(input, offset)` can be used to get a `{line,
|
||||||
|
column}` object for a given program string and offset.
|
||||||
|
|
||||||
|
### The `Parser` class
|
||||||
|
|
||||||
|
Instances of the **`Parser`** class contain all the state and logic
|
||||||
|
that drives a parse. It has static methods `parse`,
|
||||||
|
`parseExpressionAt`, and `tokenizer` that match the top-level
|
||||||
|
functions by the same name.
|
||||||
|
|
||||||
|
When extending the parser with plugins, you need to call these methods
|
||||||
|
on the extended version of the class. To extend a parser with plugins,
|
||||||
|
you can use its static `extend` method.
|
||||||
|
|
||||||
|
```javascript
|
||||||
|
var acorn = require("acorn");
|
||||||
|
var jsx = require("acorn-jsx");
|
||||||
|
var JSXParser = acorn.Parser.extend(jsx());
|
||||||
|
JSXParser.parse("foo(<bar/>)");
|
||||||
|
```
|
||||||
|
|
||||||
|
The `extend` method takes any number of plugin values, and returns a
|
||||||
|
new `Parser` class that includes the extra parser logic provided by
|
||||||
|
the plugins.
|
||||||
|
|
||||||
|
## Command line interface
|
||||||
|
|
||||||
|
The `bin/acorn` utility can be used to parse a file from the command
|
||||||
|
line. It accepts as arguments its input file and the following
|
||||||
|
options:
|
||||||
|
|
||||||
|
- `--ecma3|--ecma5|--ecma6|--ecma7|--ecma8|--ecma9|--ecma10`: Sets the ECMAScript version
|
||||||
|
to parse. Default is version 9.
|
||||||
|
|
||||||
|
- `--module`: Sets the parsing mode to `"module"`. Is set to `"script"` otherwise.
|
||||||
|
|
||||||
|
- `--locations`: Attaches a "loc" object to each node with "start" and
|
||||||
|
"end" subobjects, each of which contains the one-based line and
|
||||||
|
zero-based column numbers in `{line, column}` form.
|
||||||
|
|
||||||
|
- `--allow-hash-bang`: If the code starts with the characters #! (as
|
||||||
|
in a shellscript), the first line will be treated as a comment.
|
||||||
|
|
||||||
|
- `--compact`: No whitespace is used in the AST output.
|
||||||
|
|
||||||
|
- `--silent`: Do not output the AST, just return the exit status.
|
||||||
|
|
||||||
|
- `--help`: Print the usage information and quit.
|
||||||
|
|
||||||
|
The utility spits out the syntax tree as JSON data.
|
||||||
|
|
||||||
|
## Existing plugins
|
||||||
|
|
||||||
|
- [`acorn-jsx`](https://github.com/RReverser/acorn-jsx): Parse [Facebook JSX syntax extensions](https://github.com/facebook/jsx)
|
||||||
|
|
||||||
|
Plugins for ECMAScript proposals:
|
||||||
|
|
||||||
|
- [`acorn-stage3`](https://github.com/acornjs/acorn-stage3): Parse most stage 3 proposals, bundling:
|
||||||
|
- [`acorn-async-iteration`](https://github.com/acornjs/acorn-async-iteration): Parse [async iteration proposal](https://github.com/tc39/proposal-async-iteration)
|
||||||
|
- [`acorn-bigint`](https://github.com/acornjs/acorn-bigint): Parse [BigInt proposal](https://github.com/tc39/proposal-bigint)
|
||||||
|
- [`acorn-class-fields`](https://github.com/acornjs/acorn-class-fields): Parse [class fields proposal](https://github.com/tc39/proposal-class-fields)
|
||||||
|
- [`acorn-dynamic-import`](https://github.com/kesne/acorn-dynamic-import): Parse [import() proposal](https://github.com/tc39/proposal-dynamic-import)
|
||||||
|
- [`acorn-import-meta`](https://github.com/acornjs/acorn-import-meta): Parse [import.meta proposal](https://github.com/tc39/proposal-import-meta)
|
||||||
|
- [`acorn-numeric-separator`](https://github.com/acornjs/acorn-numeric-separator): Parse [numeric separator proposal](https://github.com/tc39/proposal-numeric-separator)
|
||||||
|
- [`acorn-private-methods`](https://github.com/acornjs/acorn-private-methods): parse [private methods, getters and setters proposal](https://github.com/tc39/proposal-private-methods)n
|
@ -1,4 +1,4 @@
|
|||||||
#!/usr/bin/env node
|
#!/usr/bin/env node
|
||||||
'use strict';
|
'use strict';
|
||||||
|
|
||||||
require('./_acorn.js');
|
require('../dist/bin.js');
|
209
deps/acorn/acorn/dist/acorn.d.ts
vendored
Normal file
209
deps/acorn/acorn/dist/acorn.d.ts
vendored
Normal file
@ -0,0 +1,209 @@
|
|||||||
|
export as namespace acorn
|
||||||
|
export = acorn
|
||||||
|
|
||||||
|
declare namespace acorn {
|
||||||
|
function parse(input: string, options?: Options): Node
|
||||||
|
|
||||||
|
function parseExpressionAt(input: string, pos?: number, options?: Options): Node
|
||||||
|
|
||||||
|
function tokenizer(input: string, options?: Options): {
|
||||||
|
getToken(): Token
|
||||||
|
[Symbol.iterator](): Iterator<Token>
|
||||||
|
}
|
||||||
|
|
||||||
|
interface Options {
|
||||||
|
ecmaVersion?: 3 | 5 | 6 | 7 | 8 | 9 | 10 | 2015 | 2016 | 2017 | 2018 | 2019
|
||||||
|
sourceType?: 'script' | 'module'
|
||||||
|
onInsertedSemicolon?: (lastTokEnd: number, lastTokEndLoc?: Position) => void
|
||||||
|
onTrailingComma?: (lastTokEnd: number, lastTokEndLoc?: Position) => void
|
||||||
|
allowReserved?: boolean
|
||||||
|
allowReturnOutsideFunction?: boolean
|
||||||
|
allowImportExportEverywhere?: boolean
|
||||||
|
allowAwaitOutsideFunction?: boolean
|
||||||
|
allowHashBang?: boolean
|
||||||
|
locations?: boolean
|
||||||
|
onToken?: ((token: Token) => any) | Token[]
|
||||||
|
onComment?: ((
|
||||||
|
isBlock: boolean, text: string, start: number, end: number, startLoc?: Position,
|
||||||
|
endLoc?: Position
|
||||||
|
) => void) | Comment[]
|
||||||
|
ranges?: boolean
|
||||||
|
program?: Node
|
||||||
|
sourceFile?: string
|
||||||
|
directSourceFile?: string
|
||||||
|
preserveParens?: boolean
|
||||||
|
}
|
||||||
|
|
||||||
|
class Parser {
|
||||||
|
constructor(options: Options, input: string, startPos?: number)
|
||||||
|
parse(): Node
|
||||||
|
static parse(input: string, options?: Options): Node
|
||||||
|
static parseExpressionAt(input: string, pos: number, options?: Options): Node
|
||||||
|
static tokenizer(input: string, options?: Options): {
|
||||||
|
getToken(): Token
|
||||||
|
[Symbol.iterator](): Iterator<Token>
|
||||||
|
}
|
||||||
|
static extend(...plugins: ((BaseParser: typeof Parser) => typeof Parser)[]): typeof Parser
|
||||||
|
}
|
||||||
|
|
||||||
|
interface Position { line: number; column: number; offset: number }
|
||||||
|
|
||||||
|
const defaultOptions: Options
|
||||||
|
|
||||||
|
function getLineInfo(input: string, offset: number): Position
|
||||||
|
|
||||||
|
class SourceLocation {
|
||||||
|
start: Position
|
||||||
|
end: Position
|
||||||
|
source?: string | null
|
||||||
|
constructor(p: Parser, start: Position, end: Position)
|
||||||
|
}
|
||||||
|
|
||||||
|
class Node {
|
||||||
|
type: string
|
||||||
|
start: number
|
||||||
|
end: number
|
||||||
|
loc?: SourceLocation
|
||||||
|
sourceFile?: string
|
||||||
|
range?: [number, number]
|
||||||
|
constructor(parser: Parser, pos: number, loc?: SourceLocation)
|
||||||
|
}
|
||||||
|
|
||||||
|
class TokenType {
|
||||||
|
label: string
|
||||||
|
keyword: string
|
||||||
|
beforeExpr: boolean
|
||||||
|
startsExpr: boolean
|
||||||
|
isLoop: boolean
|
||||||
|
isAssign: boolean
|
||||||
|
prefix: boolean
|
||||||
|
postfix: boolean
|
||||||
|
binop: number
|
||||||
|
updateContext?: (prevType: TokenType) => void
|
||||||
|
constructor(label: string, conf?: any)
|
||||||
|
}
|
||||||
|
|
||||||
|
const tokTypes: {
|
||||||
|
num: TokenType
|
||||||
|
regexp: TokenType
|
||||||
|
string: TokenType
|
||||||
|
name: TokenType
|
||||||
|
eof: TokenType
|
||||||
|
bracketL: TokenType
|
||||||
|
bracketR: TokenType
|
||||||
|
braceL: TokenType
|
||||||
|
braceR: TokenType
|
||||||
|
parenL: TokenType
|
||||||
|
parenR: TokenType
|
||||||
|
comma: TokenType
|
||||||
|
semi: TokenType
|
||||||
|
colon: TokenType
|
||||||
|
dot: TokenType
|
||||||
|
question: TokenType
|
||||||
|
arrow: TokenType
|
||||||
|
template: TokenType
|
||||||
|
ellipsis: TokenType
|
||||||
|
backQuote: TokenType
|
||||||
|
dollarBraceL: TokenType
|
||||||
|
eq: TokenType
|
||||||
|
assign: TokenType
|
||||||
|
incDec: TokenType
|
||||||
|
prefix: TokenType
|
||||||
|
logicalOR: TokenType
|
||||||
|
logicalAND: TokenType
|
||||||
|
bitwiseOR: TokenType
|
||||||
|
bitwiseXOR: TokenType
|
||||||
|
bitwiseAND: TokenType
|
||||||
|
equality: TokenType
|
||||||
|
relational: TokenType
|
||||||
|
bitShift: TokenType
|
||||||
|
plusMin: TokenType
|
||||||
|
modulo: TokenType
|
||||||
|
star: TokenType
|
||||||
|
slash: TokenType
|
||||||
|
starstar: TokenType
|
||||||
|
_break: TokenType
|
||||||
|
_case: TokenType
|
||||||
|
_catch: TokenType
|
||||||
|
_continue: TokenType
|
||||||
|
_debugger: TokenType
|
||||||
|
_default: TokenType
|
||||||
|
_do: TokenType
|
||||||
|
_else: TokenType
|
||||||
|
_finally: TokenType
|
||||||
|
_for: TokenType
|
||||||
|
_function: TokenType
|
||||||
|
_if: TokenType
|
||||||
|
_return: TokenType
|
||||||
|
_switch: TokenType
|
||||||
|
_throw: TokenType
|
||||||
|
_try: TokenType
|
||||||
|
_var: TokenType
|
||||||
|
_const: TokenType
|
||||||
|
_while: TokenType
|
||||||
|
_with: TokenType
|
||||||
|
_new: TokenType
|
||||||
|
_this: TokenType
|
||||||
|
_super: TokenType
|
||||||
|
_class: TokenType
|
||||||
|
_extends: TokenType
|
||||||
|
_export: TokenType
|
||||||
|
_import: TokenType
|
||||||
|
_null: TokenType
|
||||||
|
_true: TokenType
|
||||||
|
_false: TokenType
|
||||||
|
_in: TokenType
|
||||||
|
_instanceof: TokenType
|
||||||
|
_typeof: TokenType
|
||||||
|
_void: TokenType
|
||||||
|
_delete: TokenType
|
||||||
|
}
|
||||||
|
|
||||||
|
class TokContext {
|
||||||
|
constructor(token: string, isExpr: boolean, preserveSpace: boolean, override?: (p: Parser) => void)
|
||||||
|
}
|
||||||
|
|
||||||
|
const tokContexts: {
|
||||||
|
b_stat: TokContext
|
||||||
|
b_expr: TokContext
|
||||||
|
b_tmpl: TokContext
|
||||||
|
p_stat: TokContext
|
||||||
|
p_expr: TokContext
|
||||||
|
q_tmpl: TokContext
|
||||||
|
f_expr: TokContext
|
||||||
|
}
|
||||||
|
|
||||||
|
function isIdentifierStart(code: number, astral?: boolean): boolean
|
||||||
|
|
||||||
|
function isIdentifierChar(code: number, astral?: boolean): boolean
|
||||||
|
|
||||||
|
interface AbstractToken {
|
||||||
|
}
|
||||||
|
|
||||||
|
interface Comment extends AbstractToken {
|
||||||
|
type: string
|
||||||
|
value: string
|
||||||
|
start: number
|
||||||
|
end: number
|
||||||
|
loc?: SourceLocation
|
||||||
|
range?: [number, number]
|
||||||
|
}
|
||||||
|
|
||||||
|
class Token {
|
||||||
|
type: TokenType
|
||||||
|
value: any
|
||||||
|
start: number
|
||||||
|
end: number
|
||||||
|
loc?: SourceLocation
|
||||||
|
range?: [number, number]
|
||||||
|
constructor(p: Parser)
|
||||||
|
}
|
||||||
|
|
||||||
|
function isNewLine(code: number): boolean
|
||||||
|
|
||||||
|
const lineBreak: RegExp
|
||||||
|
|
||||||
|
const lineBreakG: RegExp
|
||||||
|
|
||||||
|
const version: string
|
||||||
|
}
|
File diff suppressed because it is too large
Load Diff
1
deps/acorn/acorn/dist/acorn.js.map
vendored
Normal file
1
deps/acorn/acorn/dist/acorn.js.map
vendored
Normal file
File diff suppressed because one or more lines are too long
File diff suppressed because it is too large
Load Diff
1
deps/acorn/acorn/dist/acorn.mjs.map
vendored
Normal file
1
deps/acorn/acorn/dist/acorn.mjs.map
vendored
Normal file
File diff suppressed because one or more lines are too long
@ -1,9 +1,8 @@
|
|||||||
#!/usr/bin/env node
|
|
||||||
'use strict';
|
'use strict';
|
||||||
|
|
||||||
var path = require('path');
|
var path = require('path');
|
||||||
var fs = require('fs');
|
var fs = require('fs');
|
||||||
var acorn = require('../dist/acorn.js');
|
var acorn = require('./acorn.js');
|
||||||
|
|
||||||
var infile;
|
var infile;
|
||||||
var forceFile;
|
var forceFile;
|
34
deps/acorn/acorn/package.json
vendored
Normal file
34
deps/acorn/acorn/package.json
vendored
Normal file
@ -0,0 +1,34 @@
|
|||||||
|
{
|
||||||
|
"name": "acorn",
|
||||||
|
"description": "ECMAScript parser",
|
||||||
|
"homepage": "https://github.com/acornjs/acorn",
|
||||||
|
"main": "dist/acorn.js",
|
||||||
|
"module": "dist/acorn.mjs",
|
||||||
|
"version": "6.0.7",
|
||||||
|
"engines": {"node": ">=0.4.0"},
|
||||||
|
"maintainers": [
|
||||||
|
{
|
||||||
|
"name": "Marijn Haverbeke",
|
||||||
|
"email": "marijnh@gmail.com",
|
||||||
|
"web": "https://marijnhaverbeke.nl"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "Ingvar Stepanyan",
|
||||||
|
"email": "me@rreverser.com",
|
||||||
|
"web": "https://rreverser.com/"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "Adrian Heine",
|
||||||
|
"web": "http://adrianheine.de"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"repository": {
|
||||||
|
"type": "git",
|
||||||
|
"url": "https://github.com/acornjs/acorn.git"
|
||||||
|
},
|
||||||
|
"license": "MIT",
|
||||||
|
"scripts": {
|
||||||
|
"prepare": "cd ..; npm run build:main && npm run build:bin"
|
||||||
|
},
|
||||||
|
"bin": {"acorn": "./bin/acorn"}
|
||||||
|
}
|
21
deps/acorn/bin/run_test262.js
vendored
21
deps/acorn/bin/run_test262.js
vendored
@ -1,21 +0,0 @@
|
|||||||
const fs = require("fs")
|
|
||||||
const path = require("path")
|
|
||||||
const run = require("test262-parser-runner")
|
|
||||||
const parse = require("..").parse
|
|
||||||
|
|
||||||
const unsupportedFeatures = [
|
|
||||||
"BigInt",
|
|
||||||
"class-fields",
|
|
||||||
"class-fields-private",
|
|
||||||
"class-fields-public",
|
|
||||||
"numeric-separator-literal"
|
|
||||||
];
|
|
||||||
|
|
||||||
run(
|
|
||||||
(content, {sourceType}) => parse(content, {sourceType, ecmaVersion: 10}),
|
|
||||||
{
|
|
||||||
testsDirectory: path.dirname(require.resolve("test262/package.json")),
|
|
||||||
skip: test => (test.attrs.features && unsupportedFeatures.some(f => test.attrs.features.includes(f))),
|
|
||||||
whitelist: fs.readFileSync("./bin/test262.whitelist", "utf8").split("\n").filter(v => v)
|
|
||||||
}
|
|
||||||
)
|
|
404
deps/acorn/bin/test262.whitelist
vendored
404
deps/acorn/bin/test262.whitelist
vendored
@ -1,404 +0,0 @@
|
|||||||
annexB/language/function-code/block-decl-func-no-skip-try.js (default)
|
|
||||||
annexB/language/function-code/block-decl-func-skip-early-err-block.js (default)
|
|
||||||
annexB/language/function-code/block-decl-func-skip-early-err.js (default)
|
|
||||||
annexB/language/function-code/block-decl-func-skip-early-err-switch.js (default)
|
|
||||||
annexB/language/function-code/block-decl-func-skip-early-err-try.js (default)
|
|
||||||
annexB/language/function-code/if-decl-else-decl-a-func-no-skip-try.js (default)
|
|
||||||
annexB/language/function-code/if-decl-else-decl-a-func-skip-early-err-block.js (default)
|
|
||||||
annexB/language/function-code/if-decl-else-decl-a-func-skip-early-err.js (default)
|
|
||||||
annexB/language/function-code/if-decl-else-decl-a-func-skip-early-err-switch.js (default)
|
|
||||||
annexB/language/function-code/if-decl-else-decl-a-func-skip-early-err-try.js (default)
|
|
||||||
annexB/language/function-code/if-decl-else-decl-b-func-no-skip-try.js (default)
|
|
||||||
annexB/language/function-code/if-decl-else-decl-b-func-skip-early-err-block.js (default)
|
|
||||||
annexB/language/function-code/if-decl-else-decl-b-func-skip-early-err.js (default)
|
|
||||||
annexB/language/function-code/if-decl-else-decl-b-func-skip-early-err-switch.js (default)
|
|
||||||
annexB/language/function-code/if-decl-else-decl-b-func-skip-early-err-try.js (default)
|
|
||||||
annexB/language/function-code/if-decl-else-stmt-func-no-skip-try.js (default)
|
|
||||||
annexB/language/function-code/if-decl-else-stmt-func-skip-early-err-block.js (default)
|
|
||||||
annexB/language/function-code/if-decl-else-stmt-func-skip-early-err.js (default)
|
|
||||||
annexB/language/function-code/if-decl-else-stmt-func-skip-early-err-switch.js (default)
|
|
||||||
annexB/language/function-code/if-decl-else-stmt-func-skip-early-err-try.js (default)
|
|
||||||
annexB/language/function-code/if-decl-no-else-func-no-skip-try.js (default)
|
|
||||||
annexB/language/function-code/if-decl-no-else-func-skip-early-err-block.js (default)
|
|
||||||
annexB/language/function-code/if-decl-no-else-func-skip-early-err.js (default)
|
|
||||||
annexB/language/function-code/if-decl-no-else-func-skip-early-err-switch.js (default)
|
|
||||||
annexB/language/function-code/if-decl-no-else-func-skip-early-err-try.js (default)
|
|
||||||
annexB/language/function-code/if-stmt-else-decl-func-no-skip-try.js (default)
|
|
||||||
annexB/language/function-code/if-stmt-else-decl-func-skip-early-err-block.js (default)
|
|
||||||
annexB/language/function-code/if-stmt-else-decl-func-skip-early-err.js (default)
|
|
||||||
annexB/language/function-code/if-stmt-else-decl-func-skip-early-err-switch.js (default)
|
|
||||||
annexB/language/function-code/if-stmt-else-decl-func-skip-early-err-try.js (default)
|
|
||||||
annexB/language/function-code/switch-case-func-no-skip-try.js (default)
|
|
||||||
annexB/language/function-code/switch-case-func-skip-early-err-block.js (default)
|
|
||||||
annexB/language/function-code/switch-case-func-skip-early-err.js (default)
|
|
||||||
annexB/language/function-code/switch-case-func-skip-early-err-switch.js (default)
|
|
||||||
annexB/language/function-code/switch-case-func-skip-early-err-try.js (default)
|
|
||||||
annexB/language/function-code/switch-dflt-func-no-skip-try.js (default)
|
|
||||||
annexB/language/function-code/switch-dflt-func-skip-early-err-block.js (default)
|
|
||||||
annexB/language/function-code/switch-dflt-func-skip-early-err.js (default)
|
|
||||||
annexB/language/function-code/switch-dflt-func-skip-early-err-switch.js (default)
|
|
||||||
annexB/language/function-code/switch-dflt-func-skip-early-err-try.js (default)
|
|
||||||
annexB/language/global-code/block-decl-global-no-skip-try.js (default)
|
|
||||||
annexB/language/global-code/block-decl-global-skip-early-err-block.js (default)
|
|
||||||
annexB/language/global-code/block-decl-global-skip-early-err.js (default)
|
|
||||||
annexB/language/global-code/block-decl-global-skip-early-err-switch.js (default)
|
|
||||||
annexB/language/global-code/block-decl-global-skip-early-err-try.js (default)
|
|
||||||
annexB/language/global-code/if-decl-else-decl-a-global-no-skip-try.js (default)
|
|
||||||
annexB/language/global-code/if-decl-else-decl-a-global-skip-early-err-block.js (default)
|
|
||||||
annexB/language/global-code/if-decl-else-decl-a-global-skip-early-err.js (default)
|
|
||||||
annexB/language/global-code/if-decl-else-decl-a-global-skip-early-err-switch.js (default)
|
|
||||||
annexB/language/global-code/if-decl-else-decl-a-global-skip-early-err-try.js (default)
|
|
||||||
annexB/language/global-code/if-decl-else-decl-b-global-no-skip-try.js (default)
|
|
||||||
annexB/language/global-code/if-decl-else-decl-b-global-skip-early-err-block.js (default)
|
|
||||||
annexB/language/global-code/if-decl-else-decl-b-global-skip-early-err.js (default)
|
|
||||||
annexB/language/global-code/if-decl-else-decl-b-global-skip-early-err-switch.js (default)
|
|
||||||
annexB/language/global-code/if-decl-else-decl-b-global-skip-early-err-try.js (default)
|
|
||||||
annexB/language/global-code/if-decl-else-stmt-global-no-skip-try.js (default)
|
|
||||||
annexB/language/global-code/if-decl-else-stmt-global-skip-early-err-block.js (default)
|
|
||||||
annexB/language/global-code/if-decl-else-stmt-global-skip-early-err.js (default)
|
|
||||||
annexB/language/global-code/if-decl-else-stmt-global-skip-early-err-switch.js (default)
|
|
||||||
annexB/language/global-code/if-decl-else-stmt-global-skip-early-err-try.js (default)
|
|
||||||
annexB/language/global-code/if-decl-no-else-global-no-skip-try.js (default)
|
|
||||||
annexB/language/global-code/if-decl-no-else-global-skip-early-err-block.js (default)
|
|
||||||
annexB/language/global-code/if-decl-no-else-global-skip-early-err.js (default)
|
|
||||||
annexB/language/global-code/if-decl-no-else-global-skip-early-err-switch.js (default)
|
|
||||||
annexB/language/global-code/if-decl-no-else-global-skip-early-err-try.js (default)
|
|
||||||
annexB/language/global-code/if-stmt-else-decl-global-no-skip-try.js (default)
|
|
||||||
annexB/language/global-code/if-stmt-else-decl-global-skip-early-err-block.js (default)
|
|
||||||
annexB/language/global-code/if-stmt-else-decl-global-skip-early-err.js (default)
|
|
||||||
annexB/language/global-code/if-stmt-else-decl-global-skip-early-err-switch.js (default)
|
|
||||||
annexB/language/global-code/if-stmt-else-decl-global-skip-early-err-try.js (default)
|
|
||||||
annexB/language/global-code/switch-case-global-no-skip-try.js (default)
|
|
||||||
annexB/language/global-code/switch-case-global-skip-early-err-block.js (default)
|
|
||||||
annexB/language/global-code/switch-case-global-skip-early-err.js (default)
|
|
||||||
annexB/language/global-code/switch-case-global-skip-early-err-switch.js (default)
|
|
||||||
annexB/language/global-code/switch-case-global-skip-early-err-try.js (default)
|
|
||||||
annexB/language/global-code/switch-dflt-global-no-skip-try.js (default)
|
|
||||||
annexB/language/global-code/switch-dflt-global-skip-early-err-block.js (default)
|
|
||||||
annexB/language/global-code/switch-dflt-global-skip-early-err.js (default)
|
|
||||||
annexB/language/global-code/switch-dflt-global-skip-early-err-switch.js (default)
|
|
||||||
annexB/language/global-code/switch-dflt-global-skip-early-err-try.js (default)
|
|
||||||
annexB/language/statements/try/catch-redeclared-for-in-var.js (default)
|
|
||||||
annexB/language/statements/try/catch-redeclared-for-in-var.js (strict mode)
|
|
||||||
annexB/language/statements/try/catch-redeclared-for-var.js (default)
|
|
||||||
annexB/language/statements/try/catch-redeclared-for-var.js (strict mode)
|
|
||||||
annexB/language/statements/try/catch-redeclared-var-statement-captured.js (default)
|
|
||||||
annexB/language/statements/try/catch-redeclared-var-statement-captured.js (strict mode)
|
|
||||||
annexB/language/statements/try/catch-redeclared-var-statement.js (default)
|
|
||||||
annexB/language/statements/try/catch-redeclared-var-statement.js (strict mode)
|
|
||||||
language/block-scope/syntax/redeclaration/async-function-declaration-attempt-to-redeclare-with-async-function-declaration.js (default)
|
|
||||||
language/block-scope/syntax/redeclaration/async-function-declaration-attempt-to-redeclare-with-async-function-declaration.js (strict mode)
|
|
||||||
language/block-scope/syntax/redeclaration/async-function-declaration-attempt-to-redeclare-with-class-declaration.js (default)
|
|
||||||
language/block-scope/syntax/redeclaration/async-function-declaration-attempt-to-redeclare-with-class-declaration.js (strict mode)
|
|
||||||
language/block-scope/syntax/redeclaration/async-function-declaration-attempt-to-redeclare-with-function-declaration.js (default)
|
|
||||||
language/block-scope/syntax/redeclaration/async-function-declaration-attempt-to-redeclare-with-function-declaration.js (strict mode)
|
|
||||||
language/block-scope/syntax/redeclaration/async-function-declaration-attempt-to-redeclare-with-generator-declaration.js (default)
|
|
||||||
language/block-scope/syntax/redeclaration/async-function-declaration-attempt-to-redeclare-with-generator-declaration.js (strict mode)
|
|
||||||
language/block-scope/syntax/redeclaration/async-function-declaration-attempt-to-redeclare-with-var-declaration.js (default)
|
|
||||||
language/block-scope/syntax/redeclaration/async-function-declaration-attempt-to-redeclare-with-var-declaration.js (strict mode)
|
|
||||||
language/block-scope/syntax/redeclaration/async-function-declaration-attempt-to-redeclare-with-async-generator-declaration.js (default)
|
|
||||||
language/block-scope/syntax/redeclaration/async-function-declaration-attempt-to-redeclare-with-async-generator-declaration.js (strict mode)
|
|
||||||
language/block-scope/syntax/redeclaration/async-generator-declaration-attempt-to-redeclare-with-async-function-declaration.js (default)
|
|
||||||
language/block-scope/syntax/redeclaration/async-generator-declaration-attempt-to-redeclare-with-async-function-declaration.js (strict mode)
|
|
||||||
language/block-scope/syntax/redeclaration/async-generator-declaration-attempt-to-redeclare-with-async-generator-declaration.js (default)
|
|
||||||
language/block-scope/syntax/redeclaration/async-generator-declaration-attempt-to-redeclare-with-async-generator-declaration.js (strict mode)
|
|
||||||
language/block-scope/syntax/redeclaration/async-generator-declaration-attempt-to-redeclare-with-class-declaration.js (default)
|
|
||||||
language/block-scope/syntax/redeclaration/async-generator-declaration-attempt-to-redeclare-with-class-declaration.js (strict mode)
|
|
||||||
language/block-scope/syntax/redeclaration/async-generator-declaration-attempt-to-redeclare-with-function-declaration.js (default)
|
|
||||||
language/block-scope/syntax/redeclaration/async-generator-declaration-attempt-to-redeclare-with-function-declaration.js (strict mode)
|
|
||||||
language/block-scope/syntax/redeclaration/async-generator-declaration-attempt-to-redeclare-with-generator-declaration.js (default)
|
|
||||||
language/block-scope/syntax/redeclaration/async-generator-declaration-attempt-to-redeclare-with-generator-declaration.js (strict mode)
|
|
||||||
language/block-scope/syntax/redeclaration/async-generator-declaration-attempt-to-redeclare-with-var-declaration.js (default)
|
|
||||||
language/block-scope/syntax/redeclaration/async-generator-declaration-attempt-to-redeclare-with-var-declaration.js (strict mode)
|
|
||||||
language/block-scope/syntax/redeclaration/class-declaration-attempt-to-redeclare-with-async-generator-declaration.js (default)
|
|
||||||
language/block-scope/syntax/redeclaration/class-declaration-attempt-to-redeclare-with-async-generator-declaration.js (strict mode)
|
|
||||||
language/block-scope/syntax/redeclaration/function-declaration-attempt-to-redeclare-with-async-generator-declaration.js (default)
|
|
||||||
language/block-scope/syntax/redeclaration/function-declaration-attempt-to-redeclare-with-async-generator-declaration.js (strict mode)
|
|
||||||
language/block-scope/syntax/redeclaration/generator-declaration-attempt-to-redeclare-with-async-generator-declaration.js (default)
|
|
||||||
language/block-scope/syntax/redeclaration/generator-declaration-attempt-to-redeclare-with-async-generator-declaration.js (strict mode)
|
|
||||||
language/block-scope/syntax/redeclaration/var-declaration-attempt-to-redeclare-with-async-generator-declaration.js (default)
|
|
||||||
language/block-scope/syntax/redeclaration/var-declaration-attempt-to-redeclare-with-async-generator-declaration.js (strict mode)
|
|
||||||
language/block-scope/syntax/redeclaration/class-declaration-attempt-to-redeclare-with-async-function-declaration.js (default)
|
|
||||||
language/block-scope/syntax/redeclaration/class-declaration-attempt-to-redeclare-with-async-function-declaration.js (strict mode)
|
|
||||||
language/block-scope/syntax/redeclaration/class-declaration-attempt-to-redeclare-with-class-declaration.js (default)
|
|
||||||
language/block-scope/syntax/redeclaration/class-declaration-attempt-to-redeclare-with-class-declaration.js (strict mode)
|
|
||||||
language/block-scope/syntax/redeclaration/class-declaration-attempt-to-redeclare-with-const-declaration.js (default)
|
|
||||||
language/block-scope/syntax/redeclaration/class-declaration-attempt-to-redeclare-with-const-declaration.js (strict mode)
|
|
||||||
language/block-scope/syntax/redeclaration/class-declaration-attempt-to-redeclare-with-function-declaration.js (default)
|
|
||||||
language/block-scope/syntax/redeclaration/class-declaration-attempt-to-redeclare-with-function-declaration.js (strict mode)
|
|
||||||
language/block-scope/syntax/redeclaration/class-declaration-attempt-to-redeclare-with-generator-declaration.js (default)
|
|
||||||
language/block-scope/syntax/redeclaration/class-declaration-attempt-to-redeclare-with-generator-declaration.js (strict mode)
|
|
||||||
language/block-scope/syntax/redeclaration/class-declaration-attempt-to-redeclare-with-let-declaration.js (default)
|
|
||||||
language/block-scope/syntax/redeclaration/class-declaration-attempt-to-redeclare-with-let-declaration.js (strict mode)
|
|
||||||
language/block-scope/syntax/redeclaration/class-declaration-attempt-to-redeclare-with-var-declaration.js (default)
|
|
||||||
language/block-scope/syntax/redeclaration/class-declaration-attempt-to-redeclare-with-var-declaration.js (strict mode)
|
|
||||||
language/block-scope/syntax/redeclaration/const-declaration-attempt-to-redeclare-with-class-declaration.js (default)
|
|
||||||
language/block-scope/syntax/redeclaration/const-declaration-attempt-to-redeclare-with-class-declaration.js (strict mode)
|
|
||||||
language/block-scope/syntax/redeclaration/function-declaration-attempt-to-redeclare-with-async-function-declaration.js (default)
|
|
||||||
language/block-scope/syntax/redeclaration/function-declaration-attempt-to-redeclare-with-async-function-declaration.js (strict mode)
|
|
||||||
language/block-scope/syntax/redeclaration/function-declaration-attempt-to-redeclare-with-class-declaration.js (default)
|
|
||||||
language/block-scope/syntax/redeclaration/function-declaration-attempt-to-redeclare-with-class-declaration.js (strict mode)
|
|
||||||
language/block-scope/syntax/redeclaration/function-declaration-attempt-to-redeclare-with-function-declaration.js (strict mode)
|
|
||||||
language/block-scope/syntax/redeclaration/function-declaration-attempt-to-redeclare-with-generator-declaration.js (default)
|
|
||||||
language/block-scope/syntax/redeclaration/function-declaration-attempt-to-redeclare-with-generator-declaration.js (strict mode)
|
|
||||||
language/block-scope/syntax/redeclaration/function-declaration-attempt-to-redeclare-with-var-declaration.js (default)
|
|
||||||
language/block-scope/syntax/redeclaration/function-declaration-attempt-to-redeclare-with-var-declaration.js (strict mode)
|
|
||||||
language/block-scope/syntax/redeclaration/generator-declaration-attempt-to-redeclare-with-async-function-declaration.js (default)
|
|
||||||
language/block-scope/syntax/redeclaration/generator-declaration-attempt-to-redeclare-with-async-function-declaration.js (strict mode)
|
|
||||||
language/block-scope/syntax/redeclaration/generator-declaration-attempt-to-redeclare-with-class-declaration.js (default)
|
|
||||||
language/block-scope/syntax/redeclaration/generator-declaration-attempt-to-redeclare-with-class-declaration.js (strict mode)
|
|
||||||
language/block-scope/syntax/redeclaration/generator-declaration-attempt-to-redeclare-with-function-declaration.js (default)
|
|
||||||
language/block-scope/syntax/redeclaration/generator-declaration-attempt-to-redeclare-with-function-declaration.js (strict mode)
|
|
||||||
language/block-scope/syntax/redeclaration/generator-declaration-attempt-to-redeclare-with-generator-declaration.js (default)
|
|
||||||
language/block-scope/syntax/redeclaration/generator-declaration-attempt-to-redeclare-with-generator-declaration.js (strict mode)
|
|
||||||
language/block-scope/syntax/redeclaration/generator-declaration-attempt-to-redeclare-with-var-declaration.js (default)
|
|
||||||
language/block-scope/syntax/redeclaration/generator-declaration-attempt-to-redeclare-with-var-declaration.js (strict mode)
|
|
||||||
language/block-scope/syntax/redeclaration/let-declaration-attempt-to-redeclare-with-class-declaration.js (default)
|
|
||||||
language/block-scope/syntax/redeclaration/let-declaration-attempt-to-redeclare-with-class-declaration.js (strict mode)
|
|
||||||
language/block-scope/syntax/redeclaration/var-declaration-attempt-to-redeclare-with-async-function-declaration.js (default)
|
|
||||||
language/block-scope/syntax/redeclaration/var-declaration-attempt-to-redeclare-with-async-function-declaration.js (strict mode)
|
|
||||||
language/block-scope/syntax/redeclaration/var-declaration-attempt-to-redeclare-with-class-declaration.js (default)
|
|
||||||
language/block-scope/syntax/redeclaration/var-declaration-attempt-to-redeclare-with-class-declaration.js (strict mode)
|
|
||||||
language/block-scope/syntax/redeclaration/var-declaration-attempt-to-redeclare-with-function-declaration.js (default)
|
|
||||||
language/block-scope/syntax/redeclaration/var-declaration-attempt-to-redeclare-with-function-declaration.js (strict mode)
|
|
||||||
language/block-scope/syntax/redeclaration/var-declaration-attempt-to-redeclare-with-generator-declaration.js (default)
|
|
||||||
language/block-scope/syntax/redeclaration/var-declaration-attempt-to-redeclare-with-generator-declaration.js (strict mode)
|
|
||||||
language/expressions/async-arrow-function/early-errors-arrow-await-in-formals-default.js (default)
|
|
||||||
language/expressions/async-arrow-function/early-errors-arrow-await-in-formals-default.js (strict mode)
|
|
||||||
language/expressions/async-arrow-function/early-errors-arrow-body-contains-super-call.js (default)
|
|
||||||
language/expressions/async-arrow-function/early-errors-arrow-body-contains-super-call.js (strict mode)
|
|
||||||
language/expressions/async-arrow-function/early-errors-arrow-body-contains-super-property.js (default)
|
|
||||||
language/expressions/async-arrow-function/early-errors-arrow-body-contains-super-property.js (strict mode)
|
|
||||||
language/expressions/async-function/early-errors-expression-body-contains-super-call.js (default)
|
|
||||||
language/expressions/async-function/early-errors-expression-body-contains-super-call.js (strict mode)
|
|
||||||
language/expressions/async-function/early-errors-expression-body-contains-super-property.js (default)
|
|
||||||
language/expressions/async-function/early-errors-expression-body-contains-super-property.js (strict mode)
|
|
||||||
language/expressions/async-function/early-errors-expression-formals-contains-super-call.js (default)
|
|
||||||
language/expressions/async-function/early-errors-expression-formals-contains-super-call.js (strict mode)
|
|
||||||
language/expressions/async-function/early-errors-expression-formals-contains-super-property.js (default)
|
|
||||||
language/expressions/async-function/early-errors-expression-formals-contains-super-property.js (strict mode)
|
|
||||||
language/expressions/class/method-param-dflt-yield.js (default)
|
|
||||||
language/expressions/class/static-method-param-dflt-yield.js (default)
|
|
||||||
language/expressions/function/early-body-super-call.js (default)
|
|
||||||
language/expressions/function/early-body-super-call.js (strict mode)
|
|
||||||
language/expressions/function/early-body-super-prop.js (default)
|
|
||||||
language/expressions/function/early-body-super-prop.js (strict mode)
|
|
||||||
language/expressions/function/early-params-super-call.js (default)
|
|
||||||
language/expressions/function/early-params-super-call.js (strict mode)
|
|
||||||
language/expressions/function/early-params-super-prop.js (default)
|
|
||||||
language/expressions/function/early-params-super-prop.js (strict mode)
|
|
||||||
language/expressions/object/method-definition/early-errors-object-method-body-contains-super-call.js (default)
|
|
||||||
language/expressions/object/method-definition/early-errors-object-method-body-contains-super-call.js (strict mode)
|
|
||||||
language/expressions/object/method-definition/early-errors-object-method-duplicate-parameters.js (default)
|
|
||||||
language/expressions/object/method-definition/early-errors-object-method-formals-contains-super-call.js (default)
|
|
||||||
language/expressions/object/method-definition/early-errors-object-method-formals-contains-super-call.js (strict mode)
|
|
||||||
language/expressions/object/method-definition/generator-super-call-body.js (default)
|
|
||||||
language/expressions/object/method-definition/generator-super-call-body.js (strict mode)
|
|
||||||
language/expressions/object/method-definition/generator-super-call-param.js (default)
|
|
||||||
language/expressions/object/method-definition/generator-super-call-param.js (strict mode)
|
|
||||||
language/expressions/object/prop-def-invalid-async-prefix.js (default)
|
|
||||||
language/expressions/object/prop-def-invalid-async-prefix.js (strict mode)
|
|
||||||
language/expressions/yield/in-iteration-stmt.js (default)
|
|
||||||
language/expressions/yield/in-iteration-stmt.js (strict mode)
|
|
||||||
language/expressions/yield/star-in-iteration-stmt.js (default)
|
|
||||||
language/expressions/yield/star-in-iteration-stmt.js (strict mode)
|
|
||||||
language/global-code/new.target-arrow.js (default)
|
|
||||||
language/global-code/new.target-arrow.js (strict mode)
|
|
||||||
language/global-code/super-call-arrow.js (default)
|
|
||||||
language/global-code/super-call-arrow.js (strict mode)
|
|
||||||
language/global-code/super-prop-arrow.js (default)
|
|
||||||
language/global-code/super-prop-arrow.js (strict mode)
|
|
||||||
language/module-code/early-export-global.js (default)
|
|
||||||
language/module-code/early-export-global.js (strict mode)
|
|
||||||
language/module-code/early-export-unresolvable.js (default)
|
|
||||||
language/module-code/early-export-unresolvable.js (strict mode)
|
|
||||||
language/statements/async-function/early-errors-declaration-body-contains-super-call.js (default)
|
|
||||||
language/statements/async-function/early-errors-declaration-body-contains-super-call.js (strict mode)
|
|
||||||
language/statements/async-function/early-errors-declaration-body-contains-super-property.js (default)
|
|
||||||
language/statements/async-function/early-errors-declaration-body-contains-super-property.js (strict mode)
|
|
||||||
language/statements/async-function/early-errors-declaration-formals-contains-super-call.js (default)
|
|
||||||
language/statements/async-function/early-errors-declaration-formals-contains-super-call.js (strict mode)
|
|
||||||
language/statements/async-function/early-errors-declaration-formals-contains-super-property.js (default)
|
|
||||||
language/statements/async-function/early-errors-declaration-formals-contains-super-property.js (strict mode)
|
|
||||||
language/expressions/async-generator/early-errors-expression-body-contains-super-call.js (default)
|
|
||||||
language/expressions/async-generator/early-errors-expression-body-contains-super-call.js (strict mode)
|
|
||||||
language/expressions/async-generator/early-errors-expression-body-contains-super-property.js (default)
|
|
||||||
language/expressions/async-generator/early-errors-expression-body-contains-super-property.js (strict mode)
|
|
||||||
language/expressions/async-generator/early-errors-expression-formals-contains-super-call.js (default)
|
|
||||||
language/expressions/async-generator/early-errors-expression-formals-contains-super-call.js (strict mode)
|
|
||||||
language/expressions/async-generator/early-errors-expression-formals-contains-super-property.js (default)
|
|
||||||
language/expressions/async-generator/early-errors-expression-formals-contains-super-property.js (strict mode)
|
|
||||||
language/statements/class/definition/early-errors-class-method-arguments-in-formal-parameters.js (default)
|
|
||||||
language/statements/class/definition/early-errors-class-method-body-contains-super-call.js (default)
|
|
||||||
language/statements/class/definition/early-errors-class-method-body-contains-super-call.js (strict mode)
|
|
||||||
language/statements/class/definition/early-errors-class-method-duplicate-parameters.js (default)
|
|
||||||
language/statements/class/definition/early-errors-class-method-eval-in-formal-parameters.js (default)
|
|
||||||
language/statements/class/definition/early-errors-class-method-formals-contains-super-call.js (default)
|
|
||||||
language/statements/class/definition/early-errors-class-method-formals-contains-super-call.js (strict mode)
|
|
||||||
language/statements/class/definition/methods-gen-yield-as-function-expression-binding-identifier.js (default)
|
|
||||||
language/statements/class/definition/methods-gen-yield-as-identifier-in-nested-function.js (default)
|
|
||||||
language/statements/class/method-param-yield.js (default)
|
|
||||||
language/statements/class/static-method-param-yield.js (default)
|
|
||||||
language/statements/class/strict-mode/with.js (default)
|
|
||||||
language/statements/class/syntax/early-errors/class-body-has-direct-super-missing-class-heritage.js (default)
|
|
||||||
language/statements/class/syntax/early-errors/class-body-has-direct-super-missing-class-heritage.js (strict mode)
|
|
||||||
language/statements/class/syntax/early-errors/class-body-method-contains-direct-super.js (default)
|
|
||||||
language/statements/class/syntax/early-errors/class-body-method-contains-direct-super.js (strict mode)
|
|
||||||
language/statements/class/syntax/early-errors/class-body-special-method-generator-contains-direct-super.js (default)
|
|
||||||
language/statements/class/syntax/early-errors/class-body-special-method-generator-contains-direct-super.js (strict mode)
|
|
||||||
language/statements/class/syntax/early-errors/class-body-special-method-get-contains-direct-super.js (default)
|
|
||||||
language/statements/class/syntax/early-errors/class-body-special-method-get-contains-direct-super.js (strict mode)
|
|
||||||
language/statements/class/syntax/early-errors/class-body-special-method-set-contains-direct-super.js (default)
|
|
||||||
language/statements/class/syntax/early-errors/class-body-special-method-set-contains-direct-super.js (strict mode)
|
|
||||||
language/statements/class/syntax/early-errors/class-body-static-method-contains-direct-super.js (default)
|
|
||||||
language/statements/class/syntax/early-errors/class-body-static-method-contains-direct-super.js (strict mode)
|
|
||||||
language/statements/class/syntax/early-errors/class-body-static-method-get-contains-direct-super.js (default)
|
|
||||||
language/statements/class/syntax/early-errors/class-body-static-method-get-contains-direct-super.js (strict mode)
|
|
||||||
language/statements/class/syntax/early-errors/class-body-static-method-set-contains-direct-super.js (default)
|
|
||||||
language/statements/class/syntax/early-errors/class-body-static-method-set-contains-direct-super.js (strict mode)
|
|
||||||
language/statements/class/syntax/early-errors/class-definition-evaluation-block-duplicate-binding.js (default)
|
|
||||||
language/statements/class/syntax/early-errors/class-definition-evaluation-block-duplicate-binding.js (strict mode)
|
|
||||||
language/statements/class/syntax/early-errors/class-definition-evaluation-scriptbody-duplicate-binding.js (default)
|
|
||||||
language/statements/class/syntax/early-errors/class-definition-evaluation-scriptbody-duplicate-binding.js (strict mode)
|
|
||||||
language/statements/const/syntax/const-declaring-let-split-across-two-lines.js (default)
|
|
||||||
language/statements/do-while/labelled-fn-stmt.js (default)
|
|
||||||
language/statements/for/head-let-bound-names-in-stmt.js (default)
|
|
||||||
language/statements/for/head-let-bound-names-in-stmt.js (strict mode)
|
|
||||||
language/statements/for-in/head-const-bound-names-in-stmt.js (default)
|
|
||||||
language/statements/for-in/head-const-bound-names-in-stmt.js (strict mode)
|
|
||||||
language/statements/for-in/head-const-bound-names-let.js (default)
|
|
||||||
language/statements/for-in/head-let-bound-names-in-stmt.js (default)
|
|
||||||
language/statements/for-in/head-let-bound-names-in-stmt.js (strict mode)
|
|
||||||
language/statements/for-in/head-let-bound-names-let.js (default)
|
|
||||||
language/statements/for-in/labelled-fn-stmt-const.js (default)
|
|
||||||
language/statements/for-in/labelled-fn-stmt-let.js (default)
|
|
||||||
language/statements/for-in/labelled-fn-stmt-lhs.js (default)
|
|
||||||
language/statements/for-in/labelled-fn-stmt-var.js (default)
|
|
||||||
language/statements/for-in/let-block-with-newline.js (default)
|
|
||||||
language/statements/for-in/let-identifier-with-newline.js (default)
|
|
||||||
language/statements/for/labelled-fn-stmt-expr.js (default)
|
|
||||||
language/statements/for/labelled-fn-stmt-let.js (default)
|
|
||||||
language/statements/for/labelled-fn-stmt-var.js (default)
|
|
||||||
language/statements/for/let-block-with-newline.js (default)
|
|
||||||
language/statements/for/let-identifier-with-newline.js (default)
|
|
||||||
language/statements/for-of/head-const-bound-names-in-stmt.js (default)
|
|
||||||
language/statements/for-of/head-const-bound-names-in-stmt.js (strict mode)
|
|
||||||
language/statements/for-of/head-const-bound-names-let.js (default)
|
|
||||||
language/statements/for-of/head-let-bound-names-in-stmt.js (default)
|
|
||||||
language/statements/for-of/head-let-bound-names-in-stmt.js (strict mode)
|
|
||||||
language/statements/for-of/head-let-bound-names-let.js (default)
|
|
||||||
language/statements/for-of/labelled-fn-stmt-const.js (default)
|
|
||||||
language/statements/for-of/labelled-fn-stmt-let.js (default)
|
|
||||||
language/statements/for-of/labelled-fn-stmt-lhs.js (default)
|
|
||||||
language/statements/for-of/labelled-fn-stmt-var.js (default)
|
|
||||||
language/statements/for-of/let-block-with-newline.js (default)
|
|
||||||
language/statements/for-of/let-identifier-with-newline.js (default)
|
|
||||||
language/statements/for-await-of/let-block-with-newline.js (default)
|
|
||||||
language/statements/for-await-of/let-identifier-with-newline.js (default)
|
|
||||||
language/statements/function/early-body-super-call.js (default)
|
|
||||||
language/statements/function/early-body-super-call.js (strict mode)
|
|
||||||
language/statements/function/early-body-super-prop.js (default)
|
|
||||||
language/statements/function/early-body-super-prop.js (strict mode)
|
|
||||||
language/statements/function/early-params-super-call.js (default)
|
|
||||||
language/statements/function/early-params-super-call.js (strict mode)
|
|
||||||
language/statements/function/early-params-super-prop.js (default)
|
|
||||||
language/statements/function/early-params-super-prop.js (strict mode)
|
|
||||||
language/statements/if/if-gen-else-gen.js (default)
|
|
||||||
language/statements/if/if-gen-else-stmt.js (default)
|
|
||||||
language/statements/if/if-gen-no-else.js (default)
|
|
||||||
language/statements/if/if-stmt-else-gen.js (default)
|
|
||||||
language/statements/if/labelled-fn-stmt-first.js (default)
|
|
||||||
language/statements/if/labelled-fn-stmt-lone.js (default)
|
|
||||||
language/statements/if/labelled-fn-stmt-second.js (default)
|
|
||||||
language/statements/if/let-block-with-newline.js (default)
|
|
||||||
language/statements/if/let-identifier-with-newline.js (default)
|
|
||||||
language/statements/labeled/let-block-with-newline.js (default)
|
|
||||||
language/statements/labeled/let-identifier-with-newline.js (default)
|
|
||||||
language/statements/let/syntax/identifier-let-disallowed-as-boundname.js (default)
|
|
||||||
language/statements/let/syntax/let-let-declaration-split-across-two-lines.js (default)
|
|
||||||
language/statements/let/syntax/let-let-declaration-with-initializer-split-across-two-lines.js (default)
|
|
||||||
language/statements/switch/syntax/redeclaration/async-function-declaration-attempt-to-redeclare-with-async-function-declaration.js (default)
|
|
||||||
language/statements/switch/syntax/redeclaration/async-function-declaration-attempt-to-redeclare-with-async-function-declaration.js (strict mode)
|
|
||||||
language/statements/switch/syntax/redeclaration/async-function-declaration-attempt-to-redeclare-with-class-declaration.js (default)
|
|
||||||
language/statements/switch/syntax/redeclaration/async-function-declaration-attempt-to-redeclare-with-class-declaration.js (strict mode)
|
|
||||||
language/statements/switch/syntax/redeclaration/async-function-declaration-attempt-to-redeclare-with-function-declaration.js (default)
|
|
||||||
language/statements/switch/syntax/redeclaration/async-function-declaration-attempt-to-redeclare-with-function-declaration.js (strict mode)
|
|
||||||
language/statements/switch/syntax/redeclaration/async-function-declaration-attempt-to-redeclare-with-generator-declaration.js (default)
|
|
||||||
language/statements/switch/syntax/redeclaration/async-function-declaration-attempt-to-redeclare-with-generator-declaration.js (strict mode)
|
|
||||||
language/statements/switch/syntax/redeclaration/async-function-declaration-attempt-to-redeclare-with-var-declaration.js (default)
|
|
||||||
language/statements/switch/syntax/redeclaration/async-function-declaration-attempt-to-redeclare-with-var-declaration.js (strict mode)
|
|
||||||
language/statements/switch/syntax/redeclaration/async-function-declaration-attempt-to-redeclare-with-async-generator-declaration.js (default)
|
|
||||||
language/statements/switch/syntax/redeclaration/async-function-declaration-attempt-to-redeclare-with-async-generator-declaration.js (strict mode)
|
|
||||||
language/statements/switch/syntax/redeclaration/async-generator-declaration-attempt-to-redeclare-with-async-function-declaration.js (default)
|
|
||||||
language/statements/switch/syntax/redeclaration/async-generator-declaration-attempt-to-redeclare-with-async-function-declaration.js (strict mode)
|
|
||||||
language/statements/switch/syntax/redeclaration/async-generator-declaration-attempt-to-redeclare-with-async-generator-declaration.js (default)
|
|
||||||
language/statements/switch/syntax/redeclaration/async-generator-declaration-attempt-to-redeclare-with-async-generator-declaration.js (strict mode)
|
|
||||||
language/statements/switch/syntax/redeclaration/async-generator-declaration-attempt-to-redeclare-with-class-declaration.js (default)
|
|
||||||
language/statements/switch/syntax/redeclaration/async-generator-declaration-attempt-to-redeclare-with-class-declaration.js (strict mode)
|
|
||||||
language/statements/switch/syntax/redeclaration/async-generator-declaration-attempt-to-redeclare-with-function-declaration.js (default)
|
|
||||||
language/statements/switch/syntax/redeclaration/async-generator-declaration-attempt-to-redeclare-with-function-declaration.js (strict mode)
|
|
||||||
language/statements/switch/syntax/redeclaration/async-generator-declaration-attempt-to-redeclare-with-generator-declaration.js (default)
|
|
||||||
language/statements/switch/syntax/redeclaration/async-generator-declaration-attempt-to-redeclare-with-generator-declaration.js (strict mode)
|
|
||||||
language/statements/switch/syntax/redeclaration/async-generator-declaration-attempt-to-redeclare-with-var-declaration.js (default)
|
|
||||||
language/statements/switch/syntax/redeclaration/async-generator-declaration-attempt-to-redeclare-with-var-declaration.js (strict mode)
|
|
||||||
language/statements/switch/syntax/redeclaration/class-declaration-attempt-to-redeclare-with-async-generator-declaration.js (default)
|
|
||||||
language/statements/switch/syntax/redeclaration/class-declaration-attempt-to-redeclare-with-async-generator-declaration.js (strict mode)
|
|
||||||
language/statements/switch/syntax/redeclaration/function-declaration-attempt-to-redeclare-with-async-generator-declaration.js (default)
|
|
||||||
language/statements/switch/syntax/redeclaration/function-declaration-attempt-to-redeclare-with-async-generator-declaration.js (strict mode)
|
|
||||||
language/statements/switch/syntax/redeclaration/generator-declaration-attempt-to-redeclare-with-async-generator-declaration.js (default)
|
|
||||||
language/statements/switch/syntax/redeclaration/generator-declaration-attempt-to-redeclare-with-async-generator-declaration.js (strict mode)
|
|
||||||
language/statements/switch/syntax/redeclaration/var-declaration-attempt-to-redeclare-with-async-generator-declaration.js (default)
|
|
||||||
language/statements/switch/syntax/redeclaration/var-declaration-attempt-to-redeclare-with-async-generator-declaration.js (strict mode)
|
|
||||||
language/statements/switch/syntax/redeclaration/class-declaration-attempt-to-redeclare-with-async-function-declaration.js (default)
|
|
||||||
language/statements/switch/syntax/redeclaration/class-declaration-attempt-to-redeclare-with-async-function-declaration.js (strict mode)
|
|
||||||
language/statements/switch/syntax/redeclaration/class-declaration-attempt-to-redeclare-with-class-declaration.js (default)
|
|
||||||
language/statements/switch/syntax/redeclaration/class-declaration-attempt-to-redeclare-with-class-declaration.js (strict mode)
|
|
||||||
language/statements/switch/syntax/redeclaration/class-declaration-attempt-to-redeclare-with-const-declaration.js (default)
|
|
||||||
language/statements/switch/syntax/redeclaration/class-declaration-attempt-to-redeclare-with-const-declaration.js (strict mode)
|
|
||||||
language/statements/switch/syntax/redeclaration/class-declaration-attempt-to-redeclare-with-function-declaration.js (default)
|
|
||||||
language/statements/switch/syntax/redeclaration/class-declaration-attempt-to-redeclare-with-function-declaration.js (strict mode)
|
|
||||||
language/statements/switch/syntax/redeclaration/class-declaration-attempt-to-redeclare-with-generator-declaration.js (default)
|
|
||||||
language/statements/switch/syntax/redeclaration/class-declaration-attempt-to-redeclare-with-generator-declaration.js (strict mode)
|
|
||||||
language/statements/switch/syntax/redeclaration/class-declaration-attempt-to-redeclare-with-let-declaration.js (default)
|
|
||||||
language/statements/switch/syntax/redeclaration/class-declaration-attempt-to-redeclare-with-let-declaration.js (strict mode)
|
|
||||||
language/statements/switch/syntax/redeclaration/class-declaration-attempt-to-redeclare-with-var-declaration.js (default)
|
|
||||||
language/statements/switch/syntax/redeclaration/class-declaration-attempt-to-redeclare-with-var-declaration.js (strict mode)
|
|
||||||
language/statements/switch/syntax/redeclaration/const-declaration-attempt-to-redeclare-with-class-declaration.js (default)
|
|
||||||
language/statements/switch/syntax/redeclaration/const-declaration-attempt-to-redeclare-with-class-declaration.js (strict mode)
|
|
||||||
language/statements/switch/syntax/redeclaration/function-declaration-attempt-to-redeclare-with-async-function-declaration.js (default)
|
|
||||||
language/statements/switch/syntax/redeclaration/function-declaration-attempt-to-redeclare-with-async-function-declaration.js (strict mode)
|
|
||||||
language/statements/switch/syntax/redeclaration/function-declaration-attempt-to-redeclare-with-class-declaration.js (default)
|
|
||||||
language/statements/switch/syntax/redeclaration/function-declaration-attempt-to-redeclare-with-class-declaration.js (strict mode)
|
|
||||||
language/statements/switch/syntax/redeclaration/function-declaration-attempt-to-redeclare-with-function-declaration.js (strict mode)
|
|
||||||
language/statements/switch/syntax/redeclaration/function-declaration-attempt-to-redeclare-with-generator-declaration.js (default)
|
|
||||||
language/statements/switch/syntax/redeclaration/function-declaration-attempt-to-redeclare-with-generator-declaration.js (strict mode)
|
|
||||||
language/statements/switch/syntax/redeclaration/function-declaration-attempt-to-redeclare-with-var-declaration.js (default)
|
|
||||||
language/statements/switch/syntax/redeclaration/function-declaration-attempt-to-redeclare-with-var-declaration.js (strict mode)
|
|
||||||
language/statements/switch/syntax/redeclaration/generator-declaration-attempt-to-redeclare-with-async-function-declaration.js (default)
|
|
||||||
language/statements/switch/syntax/redeclaration/generator-declaration-attempt-to-redeclare-with-async-function-declaration.js (strict mode)
|
|
||||||
language/statements/switch/syntax/redeclaration/generator-declaration-attempt-to-redeclare-with-class-declaration.js (default)
|
|
||||||
language/statements/switch/syntax/redeclaration/generator-declaration-attempt-to-redeclare-with-class-declaration.js (strict mode)
|
|
||||||
language/statements/switch/syntax/redeclaration/generator-declaration-attempt-to-redeclare-with-function-declaration.js (default)
|
|
||||||
language/statements/switch/syntax/redeclaration/generator-declaration-attempt-to-redeclare-with-function-declaration.js (strict mode)
|
|
||||||
language/statements/switch/syntax/redeclaration/generator-declaration-attempt-to-redeclare-with-generator-declaration.js (default)
|
|
||||||
language/statements/switch/syntax/redeclaration/generator-declaration-attempt-to-redeclare-with-generator-declaration.js (strict mode)
|
|
||||||
language/statements/switch/syntax/redeclaration/generator-declaration-attempt-to-redeclare-with-var-declaration.js (default)
|
|
||||||
language/statements/switch/syntax/redeclaration/generator-declaration-attempt-to-redeclare-with-var-declaration.js (strict mode)
|
|
||||||
language/statements/switch/syntax/redeclaration/let-declaration-attempt-to-redeclare-with-class-declaration.js (default)
|
|
||||||
language/statements/switch/syntax/redeclaration/let-declaration-attempt-to-redeclare-with-class-declaration.js (strict mode)
|
|
||||||
language/statements/switch/syntax/redeclaration/var-declaration-attempt-to-redeclare-with-async-function-declaration.js (default)
|
|
||||||
language/statements/switch/syntax/redeclaration/var-declaration-attempt-to-redeclare-with-async-function-declaration.js (strict mode)
|
|
||||||
language/statements/switch/syntax/redeclaration/var-declaration-attempt-to-redeclare-with-class-declaration.js (default)
|
|
||||||
language/statements/switch/syntax/redeclaration/var-declaration-attempt-to-redeclare-with-class-declaration.js (strict mode)
|
|
||||||
language/statements/switch/syntax/redeclaration/var-declaration-attempt-to-redeclare-with-function-declaration.js (default)
|
|
||||||
language/statements/switch/syntax/redeclaration/var-declaration-attempt-to-redeclare-with-function-declaration.js (strict mode)
|
|
||||||
language/statements/switch/syntax/redeclaration/var-declaration-attempt-to-redeclare-with-generator-declaration.js (default)
|
|
||||||
language/statements/switch/syntax/redeclaration/var-declaration-attempt-to-redeclare-with-generator-declaration.js (strict mode)
|
|
||||||
language/statements/while/labelled-fn-stmt.js (default)
|
|
||||||
language/statements/while/let-block-with-newline.js (default)
|
|
||||||
language/statements/while/let-identifier-with-newline.js (default)
|
|
||||||
language/statements/with/labelled-fn-stmt.js (default)
|
|
||||||
language/statements/with/let-block-with-newline.js (default)
|
|
||||||
language/statements/with/let-identifier-with-newline.js (default)
|
|
||||||
language/white-space/mongolian-vowel-separator.js (default)
|
|
||||||
language/white-space/mongolian-vowel-separator.js (strict mode)
|
|
0
deps/acorn/dist/.keep
vendored
0
deps/acorn/dist/.keep
vendored
1424
deps/acorn/dist/acorn_loose.es.js
vendored
1424
deps/acorn/dist/acorn_loose.es.js
vendored
File diff suppressed because it is too large
Load Diff
1434
deps/acorn/dist/acorn_loose.js
vendored
1434
deps/acorn/dist/acorn_loose.js
vendored
File diff suppressed because it is too large
Load Diff
60
deps/acorn/package.json
vendored
60
deps/acorn/package.json
vendored
@ -1,60 +0,0 @@
|
|||||||
{
|
|
||||||
"name": "acorn",
|
|
||||||
"description": "ECMAScript parser",
|
|
||||||
"homepage": "https://github.com/acornjs/acorn",
|
|
||||||
"main": "dist/acorn.js",
|
|
||||||
"module": "dist/acorn.es.js",
|
|
||||||
"version": "5.7.2",
|
|
||||||
"engines": {
|
|
||||||
"node": ">=0.4.0"
|
|
||||||
},
|
|
||||||
"maintainers": [
|
|
||||||
{
|
|
||||||
"name": "Marijn Haverbeke",
|
|
||||||
"email": "marijnh@gmail.com",
|
|
||||||
"web": "http://marijnhaverbeke.nl"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "Ingvar Stepanyan",
|
|
||||||
"email": "me@rreverser.com",
|
|
||||||
"web": "http://rreverser.com/"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "Adrian Heine",
|
|
||||||
"email": "http://adrianheine.de"
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"repository": {
|
|
||||||
"type": "git",
|
|
||||||
"url": "https://github.com/acornjs/acorn.git"
|
|
||||||
},
|
|
||||||
"license": "MIT",
|
|
||||||
"scripts": {
|
|
||||||
"prepare": "npm run build && node test/run.js && node test/lint.js",
|
|
||||||
"test": "node test/run.js && node test/lint.js",
|
|
||||||
"pretest": "npm run build:main && npm run build:loose",
|
|
||||||
"test:test262": "node bin/run_test262.js",
|
|
||||||
"build": "npm run build:main && npm run build:walk && npm run build:loose && npm run build:bin",
|
|
||||||
"build:main": "rollup -c rollup/config.main.js",
|
|
||||||
"build:walk": "rollup -c rollup/config.walk.js",
|
|
||||||
"build:loose": "rollup -c rollup/config.loose.js && rollup -c rollup/config.loose_es.js",
|
|
||||||
"build:bin": "rollup -c rollup/config.bin.js",
|
|
||||||
"lint": "eslint src/"
|
|
||||||
},
|
|
||||||
"bin": {
|
|
||||||
"acorn": "./bin/acorn"
|
|
||||||
},
|
|
||||||
"devDependencies": {
|
|
||||||
"eslint": "^4.10.0",
|
|
||||||
"eslint-config-standard": "^10.2.1",
|
|
||||||
"eslint-plugin-import": "^2.2.0",
|
|
||||||
"eslint-plugin-node": "^5.2.1",
|
|
||||||
"eslint-plugin-promise": "^3.5.0",
|
|
||||||
"eslint-plugin-standard": "^3.0.1",
|
|
||||||
"rollup": "^0.45.0",
|
|
||||||
"rollup-plugin-buble": "^0.16.0",
|
|
||||||
"test262": "git+https://github.com/tc39/test262.git#3bfad28cc302fd4455badcfcbca7c5bb7ce41a72",
|
|
||||||
"test262-parser-runner": "^0.4.0",
|
|
||||||
"unicode-11.0.0": "^0.7.7"
|
|
||||||
}
|
|
||||||
}
|
|
@ -200,8 +200,8 @@ function getCode(fd, line, column) {
|
|||||||
function parseCode(code, offset) {
|
function parseCode(code, offset) {
|
||||||
// Lazy load acorn.
|
// Lazy load acorn.
|
||||||
if (parseExpressionAt === undefined) {
|
if (parseExpressionAt === undefined) {
|
||||||
({ parseExpressionAt } = require('internal/deps/acorn/dist/acorn'));
|
({ parseExpressionAt } = require('internal/deps/acorn/acorn/dist/acorn'));
|
||||||
({ findNodeAround } = require('internal/deps/acorn/dist/walk'));
|
({ findNodeAround } = require('internal/deps/acorn/acorn-walk/dist/walk'));
|
||||||
}
|
}
|
||||||
let node;
|
let node;
|
||||||
let start = 0;
|
let start = 0;
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
'use strict';
|
'use strict';
|
||||||
|
|
||||||
const acorn = require('internal/deps/acorn/dist/acorn');
|
const acorn = require('internal/deps/acorn/acorn/dist/acorn');
|
||||||
const walk = require('internal/deps/acorn/dist/walk');
|
const walk = require('internal/deps/acorn/acorn-walk/dist/walk');
|
||||||
|
|
||||||
const noop = () => {};
|
const noop = () => {};
|
||||||
const visitorsWithoutAncestors = {
|
const visitorsWithoutAncestors = {
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
'use strict';
|
'use strict';
|
||||||
|
|
||||||
const acorn = require('internal/deps/acorn/dist/acorn');
|
const acorn = require('internal/deps/acorn/acorn/dist/acorn');
|
||||||
const { tokTypes: tt } = acorn;
|
const { tokTypes: tt, Parser: AcornParser } = acorn;
|
||||||
|
|
||||||
// If the error is that we've unexpectedly ended the input,
|
// If the error is that we've unexpectedly ended the input,
|
||||||
// then let the user try to recover by adding more input.
|
// then let the user try to recover by adding more input.
|
||||||
@ -26,17 +26,13 @@ function isRecoverableError(e, code) {
|
|||||||
// change these messages in the future, this will lead to a test
|
// change these messages in the future, this will lead to a test
|
||||||
// failure, indicating that this code needs to be updated.
|
// failure, indicating that this code needs to be updated.
|
||||||
//
|
//
|
||||||
acorn.plugins.replRecoverable = (parser) => {
|
const RecoverableParser = AcornParser.extend((Parser) => {
|
||||||
parser.extend('nextToken', (nextToken) => {
|
return class extends Parser {
|
||||||
return function() {
|
nextToken() {
|
||||||
Reflect.apply(nextToken, this, []);
|
super.nextToken();
|
||||||
|
|
||||||
if (this.type === tt.eof) recoverable = true;
|
if (this.type === tt.eof) recoverable = true;
|
||||||
};
|
}
|
||||||
});
|
raise(pos, message) {
|
||||||
|
|
||||||
parser.extend('raise', (raise) => {
|
|
||||||
return function(pos, message) {
|
|
||||||
switch (message) {
|
switch (message) {
|
||||||
case 'Unterminated template':
|
case 'Unterminated template':
|
||||||
case 'Unterminated comment':
|
case 'Unterminated comment':
|
||||||
@ -48,11 +44,10 @@ function isRecoverableError(e, code) {
|
|||||||
// See https://www.ecma-international.org/ecma-262/#sec-line-terminators
|
// See https://www.ecma-international.org/ecma-262/#sec-line-terminators
|
||||||
recoverable = /\\(?:\r\n?|\n|\u2028|\u2029)$/.test(token);
|
recoverable = /\\(?:\r\n?|\n|\u2028|\u2029)$/.test(token);
|
||||||
}
|
}
|
||||||
|
super.raise(pos, message);
|
||||||
Reflect.apply(raise, this, [pos, message]);
|
}
|
||||||
};
|
};
|
||||||
});
|
});
|
||||||
};
|
|
||||||
|
|
||||||
// For similar reasons as `defaultEval`, wrap expressions starting with a
|
// For similar reasons as `defaultEval`, wrap expressions starting with a
|
||||||
// curly brace with parenthesis. Note: only the open parenthesis is added
|
// curly brace with parenthesis. Note: only the open parenthesis is added
|
||||||
@ -63,7 +58,7 @@ function isRecoverableError(e, code) {
|
|||||||
// Try to parse the code with acorn. If the parse fails, ignore the acorn
|
// Try to parse the code with acorn. If the parse fails, ignore the acorn
|
||||||
// error and return the recoverable status.
|
// error and return the recoverable status.
|
||||||
try {
|
try {
|
||||||
acorn.parse(code, { plugins: { replRecoverable: true }, ecmaVersion: 10 });
|
RecoverableParser.parse(code, { ecmaVersion: 10 });
|
||||||
|
|
||||||
// Odd case: the underlying JS engine (V8, Chakra) rejected this input
|
// Odd case: the underlying JS engine (V8, Chakra) rejected this input
|
||||||
// but Acorn detected no issue. Presume that additional text won't
|
// but Acorn detected no issue. Presume that additional text won't
|
||||||
|
@ -50,7 +50,7 @@ const {
|
|||||||
const {
|
const {
|
||||||
isIdentifierStart,
|
isIdentifierStart,
|
||||||
isIdentifierChar
|
isIdentifierChar
|
||||||
} = require('internal/deps/acorn/dist/acorn');
|
} = require('internal/deps/acorn/acorn/dist/acorn');
|
||||||
const internalUtil = require('internal/util');
|
const internalUtil = require('internal/util');
|
||||||
const util = require('util');
|
const util = require('util');
|
||||||
const Stream = require('stream');
|
const Stream = require('stream');
|
||||||
|
4
node.gyp
4
node.gyp
@ -219,8 +219,8 @@
|
|||||||
'deps/node-inspect/lib/_inspect.js',
|
'deps/node-inspect/lib/_inspect.js',
|
||||||
'deps/node-inspect/lib/internal/inspect_client.js',
|
'deps/node-inspect/lib/internal/inspect_client.js',
|
||||||
'deps/node-inspect/lib/internal/inspect_repl.js',
|
'deps/node-inspect/lib/internal/inspect_repl.js',
|
||||||
'deps/acorn/dist/acorn.js',
|
'deps/acorn/acorn/dist/acorn.js',
|
||||||
'deps/acorn/dist/walk.js',
|
'deps/acorn/acorn-walk/dist/walk.js',
|
||||||
],
|
],
|
||||||
'conditions': [
|
'conditions': [
|
||||||
[ 'node_shared=="true"', {
|
[ 'node_shared=="true"', {
|
||||||
|
@ -18,7 +18,7 @@
|
|||||||
// `function X(...) {...}`). Over time, we expect to handle more
|
// `function X(...) {...}`). Over time, we expect to handle more
|
||||||
// cases (example: ES2015 class definitions).
|
// cases (example: ES2015 class definitions).
|
||||||
|
|
||||||
const acorn = require('../../deps/acorn');
|
const acorn = require('../../deps/acorn/acorn');
|
||||||
const fs = require('fs');
|
const fs = require('fs');
|
||||||
const path = require('path');
|
const path = require('path');
|
||||||
const child_process = require('child_process');
|
const child_process = require('child_process');
|
||||||
|
@ -29,7 +29,7 @@ fi
|
|||||||
|
|
||||||
|
|
||||||
# Dependencies bundled in distributions
|
# Dependencies bundled in distributions
|
||||||
addlicense "Acorn" "deps/acorn" "$(cat ${rootdir}/deps/acorn/LICENSE)"
|
addlicense "Acorn" "deps/acorn" "$(cat ${rootdir}/deps/acorn/acorn/LICENSE)"
|
||||||
addlicense "c-ares" "deps/cares" "$(tail -n +3 ${rootdir}/deps/cares/LICENSE.md)"
|
addlicense "c-ares" "deps/cares" "$(tail -n +3 ${rootdir}/deps/cares/LICENSE.md)"
|
||||||
addlicense "HTTP Parser" "deps/http_parser" "$(cat deps/http_parser/LICENSE-MIT)"
|
addlicense "HTTP Parser" "deps/http_parser" "$(cat deps/http_parser/LICENSE-MIT)"
|
||||||
if [ -f "${rootdir}/deps/icu/LICENSE" ]; then
|
if [ -f "${rootdir}/deps/icu/LICENSE" ]; then
|
||||||
|
Loading…
x
Reference in New Issue
Block a user