Skip to content

Commit

Permalink
deps: update Acorn to v8.8.0
Browse files Browse the repository at this point in the history
PR-URL: #44437
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
Reviewed-By: Darshan Sen <raisinten@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
  • Loading branch information
targos authored and RafaelGSS committed Sep 7, 2022
1 parent dcc1cf4 commit 255e7fb
Show file tree
Hide file tree
Showing 9 changed files with 177 additions and 148 deletions.
2 changes: 1 addition & 1 deletion LICENSE
Expand Up @@ -55,7 +55,7 @@ The externally maintained libraries used by Node.js are:
"""
MIT License

Copyright (C) 2012-2020 by various contributors (see AUTHORS)
Copyright (C) 2012-2022 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
Expand Down
22 changes: 22 additions & 0 deletions deps/acorn/acorn/CHANGELOG.md
@@ -1,3 +1,25 @@
## 8.8.0 (2022-07-21)

### Bug fixes

Allow parentheses around spread args in destructuring object assignment.

Fix an issue where the tree contained `directive` properties in when parsing with a language version that doesn't support them.

### New features

Support hashbang comments by default in ECMAScript 2023 and later.

## 8.7.1 (2021-04-26)

### Bug fixes

Stop handling `"use strict"` directives in ECMAScript versions before 5.

Fix an issue where duplicate quoted export names in `export *` syntax were incorrectly checked.

Add missing type for `tokTypes`.

## 8.7.0 (2021-12-27)

### New features
Expand Down
2 changes: 1 addition & 1 deletion deps/acorn/acorn/LICENSE
@@ -1,6 +1,6 @@
MIT License

Copyright (C) 2012-2020 by various contributors (see AUTHORS)
Copyright (C) 2012-2022 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
Expand Down
21 changes: 7 additions & 14 deletions deps/acorn/acorn/README.md
Expand Up @@ -54,10 +54,10 @@ required):

- **ecmaVersion**: Indicates the ECMAScript version to parse. Must be
either 3, 5, 6 (or 2015), 7 (2016), 8 (2017), 9 (2018), 10 (2019),
11 (2020), 12 (2021), 13 (2022, partial support)
or `"latest"` (the latest the library supports). This influences
support for strict mode, the set of reserved words, and support
for new syntax features.
11 (2020), 12 (2021), 13 (2022), 14 (2023), or `"latest"` (the
latest the library supports). This influences support for strict
mode, the set of reserved words, and support for new syntax
features.

**NOTE**: Only 'stage 4' (finalized) ECMAScript features are being
implemented by Acorn. Other proposed new features must be
Expand Down Expand Up @@ -104,9 +104,9 @@ required):
- **allowSuperOutsideMethod**: By default, `super` outside a method
raises an error. Set this to `true` to accept such code.

- **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.
- **allowHashBang**: When this is enabled, if the code starts with the
characters `#!` (as in a shellscript), the first line will be
treated as a comment. Defaults to true when `ecmaVersion` >= 2023.

- **locations**: When `true`, each node has a `loc` object attached
with `start` and `end` subobjects, each of which contains the
Expand Down Expand Up @@ -271,10 +271,3 @@ 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-class-fields`](https://github.com/acornjs/acorn-class-fields): Parse [class fields proposal](https://github.com/tc39/proposal-class-fields)
- [`acorn-import-meta`](https://github.com/acornjs/acorn-import-meta): Parse [import.meta proposal](https://github.com/tc39/proposal-import-meta)
- [`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
4 changes: 2 additions & 2 deletions deps/acorn/acorn/bin/acorn
@@ -1,4 +1,4 @@
#!/usr/bin/env node
'use strict';
"use strict"

require('../dist/bin.js');
require("../dist/bin.js")
40 changes: 39 additions & 1 deletion deps/acorn/acorn/dist/acorn.d.ts
Expand Up @@ -11,8 +11,10 @@ declare namespace acorn {
[Symbol.iterator](): Iterator<Token>
}

type ecmaVersion = 3 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 2015 | 2016 | 2017 | 2018 | 2019 | 2020 | 2021 | 2022 | 'latest'

interface Options {
ecmaVersion: 3 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 2015 | 2016 | 2017 | 2018 | 2019 | 2020 | 2021 | 2022 | 'latest'
ecmaVersion: ecmaVersion
sourceType?: 'script' | 'module'
onInsertedSemicolon?: (lastTokEnd: number, lastTokEndLoc?: Position) => void
onTrailingComma?: (lastTokEnd: number, lastTokEndLoc?: Position) => void
Expand All @@ -36,8 +38,41 @@ declare namespace acorn {
}

class Parser {
// state.js
lineStart: number;
options: Options;
curLine: number;
start: number;
end: number;
input: string;
type: TokenType;

// state.js
constructor(options: Options, input: string, startPos?: number)
parse(this: Parser): Node

// tokenize.js
next(): void;
nextToken(): void;

// statement.js
parseTopLevel(node: Node): Node;

// node.js
finishNode(node: Node, type: string): Node;
finishNodeAt(node: Node, type: string, pos: number, loc: Position): Node;

// location.js
raise(pos: number, message: string) : void;
raiseRecoverable?(pos: number, message: string) : void;

// parseutils.js
unexpected(pos: number) : void;

// index.js
static acorn: typeof acorn;

// state.js
static parse(this: typeof Parser, input: string, options: Options): Node
static parseExpressionAt(this: typeof Parser, input: string, pos: number, options: Options): Node
static tokenizer(this: typeof Parser, input: string, options: Options): {
Expand Down Expand Up @@ -102,8 +137,10 @@ declare namespace acorn {
colon: TokenType
dot: TokenType
question: TokenType
questionDot: TokenType
arrow: TokenType
template: TokenType
invalidTemplate: TokenType
ellipsis: TokenType
backQuote: TokenType
dollarBraceL: TokenType
Expand All @@ -124,6 +161,7 @@ declare namespace acorn {
star: TokenType
slash: TokenType
starstar: TokenType
coalesce: TokenType
_break: TokenType
_case: TokenType
_catch: TokenType
Expand Down

0 comments on commit 255e7fb

Please sign in to comment.