acorn을(를) 7.x에서 8.x로 업그레이드하기
acorn 7.4.1과 8.18.0의 공개 API를 TypeScript 타입에서 자동으로 비교한 결과입니다. 시그니처 변경은 호환성이 깨질 가능성이 있다는 뜻이며 확정은 아닙니다.
요약
| 삭제된 import 경로 | 0 |
|---|---|
| 삭제된 export | 8 |
| 변경된 시그니처 | 6 |
| 삭제된 클래스·인터페이스 멤버 | 11 |
| 변경된 클래스·인터페이스 멤버 | 15 |
| 새로 지원 중단됨 | 0 |
| 요구 사항 변경 (engines, peer 의존성) | 0 |
| 새 export | 91 |
삭제된 export
| import | export | kind | 이전 |
|---|---|---|---|
acorn | isNewLine | function | (code: number): boolean |
acorn | lineBreak | variable | RegExp |
acorn | TokContext | class | class |
acorn | lineBreakG | variable | RegExp |
acorn | tokContexts | variable | { b_stat: TokContext; b_expr: TokContext; b_tmpl: TokContext; p_stat: TokContext; p_expr: TokContext; q_tmpl: TokContext; f_expr: TokContext; } |
acorn | AbstractToken | interface | interface |
acorn | isIdentifierChar | function | (code: number, astral?: boolean | undefined): boolean |
acorn | isIdentifierStart | function | (code: number, astral?: boolean | undefined): boolean |
변경된 시그니처
| export | 이전 | 이후 |
|---|---|---|
acorn · Node | class | interface |
acorn · parse | (input: string, options?: Options | undefined): Node | (input: string, options: Options): Program |
acorn · 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: T… | { num: TokenType; regexp: TokenType; string: TokenType; name: TokenType; privateId: 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; questionDot: TokenType; arrow: TokenType; template: TokenType; invalidTemplate: TokenType; ellipsis: TokenType; backQuote: TokenType; dollarBraceL: TokenType; eq: TokenType; assign: TokenType; incDec: TokenType; prefix: TokenType; logicalOR: TokenType; logicalAND: TokenType; bitwi… |
acorn · tokenizer | (input: string, options?: Options | undefined): { getToken(): Token; [Symbol.iterator](): Iterator<Token, any, any>; } | (input: string, options: Options): { getToken(): Token; [Symbol.iterator](): Iterator<Token, any, any>; } |
acorn · SourceLocation | class | interface |
acorn · parseExpressionAt | (input: string, pos?: number | undefined, options?: Options | undefined): Node | (input: string, pos: number, options: Options): Expression |
삭제된 클래스·인터페이스 멤버
| member | import | 이전 |
|---|---|---|
Node.sourceFile | acorn | string | undefined |
Token.value | acorn | any |
Position.offset | acorn | number |
TokenType.binop | acorn | number |
TokenType.isLoop | acorn | boolean |
TokenType.prefix | acorn | boolean |
TokenType.postfix | acorn | boolean |
TokenType.isAssign | acorn | boolean |
TokenType.beforeExpr | acorn | boolean |
TokenType.startsExpr | acorn | boolean |
TokenType.updateContext | acorn | ((prevType: TokenType) => void) | undefined |
변경된 클래스·인터페이스 멤버
| member | 이전 | 이후 |
|---|---|---|
Node.loc | SourceLocation | undefined | SourceLocation | null | undefined |
Node.constructor | (parser: Parser, pos: number, loc?: SourceLocation | undefined): Node | |
Token.constructor | (p: Parser): Token | (): Token |
Parser.parse | (this: Parser): Node | (): Program |
Parser.static parse | (this: typeof Parser, input: string, options?: Options | undefined): Node | (input: string, options: Options): Program |
Parser.static extend | (this: typeof Parser, ...plugins: ((BaseParser: typeof Parser) => typeof Parser)[]): typeof Parser | (...plugins: ((BaseParser: typeof Parser) => typeof Parser)[]): typeof Parser |
Parser.static tokenizer | (this: typeof Parser, input: string, options?: Options | undefined): { getToken(): Token; [Symbol.iterator](): Iterator<Token, any, any>; } | (input: string, options: Options): { getToken(): Token; [Symbol.iterator](): Iterator<Token, any, any>; } |
Parser.static parseExpressionAt | (this: typeof Parser, input: string, pos: number, options?: Options | undefined): Node | (input: string, pos: number, options: Options): Expression |
Comment.type | string | "Line" | "Block" |
Options.onToken | ((token: Token) => any) | Token[] | undefined | ((token: Token) => void) | Token[] | undefined |
Options.sourceType | "script" | "module" | undefined | "script" | "module" | "commonjs" | undefined |
Options.ecmaVersion | 3 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 2015 | 2016 | 2017 | 2018 | 2019 | 2020 | undefined | ecmaVersion |
TokenType.keyword | string | string | undefined |
TokenType.constructor | (label: string, conf?: any): TokenType | (): TokenType |
SourceLocation.constructor | (p: Parser, start: Position, end: Position): SourceLocation | |
새로 지원 중단됨
감지되지 않았습니다.
요구 사항 변경 (engines, peer 의존성)
감지되지 않았습니다.
새 export (91)
| import | export | kind |
|---|---|---|
acorn | Class | interface |
acorn | Super | interface |
acorn | AnyNode | type |
acorn | Literal | interface |
acorn | Pattern | type |
acorn | Program | interface |
acorn | Function | interface |
acorn | Property | interface |
acorn | ClassBody | interface |
acorn | NodeTypes | interface |
acorn | Statement | type |
acorn | Expression | type |
acorn | Identifier | interface |
acorn | SwitchCase | interface |
acorn | CatchClause | interface |
acorn | Declaration | type |
acorn | IfStatement | interface |
acorn | RestElement | interface |
acorn | StaticBlock | interface |
acorn | ecmaVersion | type |
acorn | ArrayPattern | interface |
acorn | ForStatement | interface |
acorn | MetaProperty | interface |
acorn | TryStatement | interface |
acorn | NewExpression | interface |
acorn | ObjectPattern | interface |
acorn | SpreadElement | interface |
acorn | UnaryOperator | type |
acorn | WithStatement | interface |
acorn | BinaryOperator | type |
acorn | BlockStatement | interface |
acorn | BreakStatement | interface |
acorn | CallExpression | interface |
acorn | EmptyStatement | interface |
acorn | ForInStatement | interface |
acorn | ForOfStatement | interface |
acorn | ThisExpression | interface |
acorn | ThrowStatement | interface |
acorn | UpdateOperator | type |
acorn | WhileStatement | interface |
acorn | ArrayExpression | interface |
acorn | AwaitExpression | interface |
acorn | ChainExpression | interface |
acorn | ClassExpression | interface |
acorn | ExportSpecifier | interface |
acorn | ImportAttribute | interface |
acorn | ImportSpecifier | interface |
acorn | LogicalOperator | type |
acorn | ReturnStatement | interface |
acorn | SwitchStatement | interface |
acorn | TemplateElement | interface |
acorn | TemplateLiteral | interface |
acorn | UnaryExpression | interface |
acorn | YieldExpression | interface |
acorn | BinaryExpression | interface |
acorn | ClassDeclaration | interface |
acorn | DoWhileStatement | interface |
acorn | ImportExpression | interface |
acorn | LabeledStatement | interface |
acorn | MemberExpression | interface |
acorn | MethodDefinition | interface |
acorn | ObjectExpression | interface |
acorn | UpdateExpression | interface |
acorn | AssignmentPattern | interface |
acorn | ContinueStatement | interface |
acorn | DebuggerStatement | interface |
acorn | ImportDeclaration | interface |
acorn | LogicalExpression | interface |
acorn | ModuleDeclaration | type |
acorn | PrivateIdentifier | interface |
acorn | AssignmentOperator | type |
acorn | AssignmentProperty | interface |
acorn | FunctionExpression | interface |
acorn | PropertyDefinition | interface |
acorn | SequenceExpression | interface |
acorn | VariableDeclarator | interface |
acorn | ExpressionStatement | interface |
acorn | FunctionDeclaration | interface |
acorn | VariableDeclaration | interface |
acorn | AssignmentExpression | interface |
acorn | ExportAllDeclaration | interface |
acorn | ConditionalExpression | interface |
acorn | ExportNamedDeclaration | interface |
acorn | ImportDefaultSpecifier | interface |
acorn | ArrowFunctionExpression | interface |
acorn | ParenthesizedExpression | interface |
acorn | ExportDefaultDeclaration | interface |
acorn | ImportNamespaceSpecifier | interface |
acorn | TaggedTemplateExpression | interface |
acorn | AnonymousClassDeclaration | interface |
acorn | AnonymousFunctionDeclaration | interface |
두 버전 사이의 changelog
패키지 작성자가 공개한 텍스트를 그대로 표시합니다.
8.18.0
### New features
The new `startLocation` option can now be used to tell the parser the line and column the parse starts at (mostly useful with `parseExpressionAt`).
### Bug fixes
Reject uses of `**` with a non-parenthesized arrow function as left-hand side.
Avoid computing the start line in `parseExpressionAt` when locations aren't used.8.17.0
### New features
The new `strict` option can be used to start script sources in strict mode.
### Bug fixes
Fix a number of corner case bugs when `using` or `await using` appear in `for` loop specs.
Disallow `new super()` expressions.
Don't allow the conditional in a ternary expression to be a (naked) arrow function.8.16.0
### New features
The `sourceType` option can now be set to `"commonjs"` to have the parser treat the top level scope as a function scope.
Add support for Unicode 17.
### Bug fixes
Don't recognize `await using` as contextual keywords when followed directly by a backslash.
Fix an issue where the parser would allow `return` statements in `static` blocks when `allowReturnOutsideFunction` was enabled.
Properly reject `using` declarations that appear directly in `switch` or `for` head scopes.
Fix some corner case issues in the recognition of `using` syntax.8.15.0
### New features
Support `using` and `await using` syntax.
The `AnyNode` type is now defined in such a way that plugins can extend it.
### Bug fixes
Fix an issue where the `bigint` property of literal nodes for non-decimal bigints had the wrong format.
The `acorn` CLI tool no longer crashes when emitting a tree that contains a bigint.8.14.1
### Bug fixes
Fix an issue where `await` expressions in class field initializers were inappropriately allowed.
Properly allow await inside an async arrow function inside a class field initializer.
Mention the source file name in syntax error messages when given.
Properly add an empty `attributes` property to every form of `ExportNamedDeclaration`.8.14.0
### New features
Support ES2025 import attributes.
Support ES2025 RegExp modifiers.
### Bug fixes
Support some missing Unicode properties.8.13.0
### New features
Upgrade to Unicode 16.0.8.12.1
### Bug fixes
Fix a regression that caused Acorn to no longer run on Node versions <8.10.8.12.0
### New features
Support ES2025 duplicate capture group names in regular expressions.
### Bug fixes
Include `VariableDeclarator` in the `AnyNode` type so that walker objects can refer to it without getting a type error.
Properly raise a parse error for invalid `for`/`of` statements using `async` as binding name.
Properly recognize \"use strict\" when preceded by a string with an escaped newline.
Mark the `Parser` constructor as protected, not private, so plugins can extend it without type errors.
Fix a bug where some invalid `delete` expressions were let through when the operand was parenthesized and `preserveParens` was enabled.
Properly normalize line endings in raw strings of invalid template tokens.
Properly track line numbers for escaped newlines in strings.
Fix a bug that broke line number accounting after a template literal with invalid escape sequences.8.11.3
### Bug fixes
Add `Function` and `Class` to the `AggregateType` type, so that they can be used in walkers without raising a type error.
Make sure `onToken` get an `import` keyword token when parsing `import.meta`.
Fix a bug where `.loc.start` could be undefined for `new.target` `meta` nodes.8.11.2
### Bug fixes
Fix a bug that caused regular expressions after colon tokens to not be properly tokenized in some circumstances.8.11.1
### Bug fixes
Fix a regression where `onToken` would receive 'name' tokens for 'new' keyword tokens.8.11.0
### Bug fixes
Fix an issue where tokenizing (without parsing) an object literal with a property named `class` or `function` could, in some circumstance, put the tokenizer into an invalid state.
Fix an issue where a slash after a call to a propery named the same as some keywords would be tokenized as a regular expression.
### New features
Upgrade to Unicode 15.1.
Use a set of new, much more precise, TypeScript types.8.10.0
### New features
Add a `checkPrivateFields` option that disables strict checking of private property use.8.9.0
### Bug fixes
Forbid dynamic import after `new`, even when part of a member expression.
### New features
Add Unicode properties for ES2023.
Add support for the `v` flag to regular expressions.8.8.2
### Bug fixes
Fix a bug that caused `allowHashBang` to be set to false when not provided, even with `ecmaVersion >= 14`.
Fix an exception when passing no option object to `parse` or `new Parser`.
Fix incorrect parse error on `if (0) let\n[astral identifier char]`.8.8.1
### Bug fixes
Make type for `Comment` compatible with estree types.8.8.0
### 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
### 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
### New features
Support quoted export names.
Upgrade to Unicode 14.
Add support for Unicode 13 properties in regular expressions.
### Bug fixes
Use a loop to find line breaks, because the existing regexp search would overrun the end of the searched range and waste a lot of time in minified code.8.6.0
### Bug fixes
Fix a bug where an object literal with multiple `__proto__` properties would incorrectly be accepted if a later property value held an assigment.
### New features
Support class private fields with the `in` operator.8.5.0
### Bug fixes
Improve context-dependent tokenization in a number of corner cases.
Fix location tracking after a 0x2028 or 0x2029 character in a string literal (which before did not increase the line number).
Fix an issue where arrow function bodies in for loop context would inappropriately consume `in` operators.
Fix wrong end locations stored on SequenceExpression nodes.
Implement restriction that `for`/`of` loop LHS can't start with `let`.
### New features
Add support for ES2022 class static blocks.
Allow multiple input files to be passed to the CLI tool.8.4.1
### Bug fixes
Fix a bug where `allowAwaitOutsideFunction` would allow `await` in class field initializers, and setting `ecmaVersion` to 13 or higher would allow top-level await in non-module sources.8.4.0
### New features
A new option, `allowSuperOutsideMethod`, can be used to suppress the error when `super` is used in the wrong context.8.3.0
### New features
Default `allowAwaitOutsideFunction` to true for ECMAScript 2022 an higher.
Add support for the `d` ([indices](https://github.com/tc39/proposal-regexp-match-indices)) regexp flag.8.2.4
### Bug fixes
Fix spec conformity in corner case 'for await (async of ...)'.8.2.3
### Bug fixes
Fix an issue where the library couldn't parse 'for (async of ...)'.
Fix a bug in UTF-16 decoding that would read characters incorrectly in some circumstances.8.2.2
### Bug fixes
Fix a bug where a class field initialized to an async arrow function wouldn't allow await inside it. Same issue existed for generator arrow functions with yield.8.2.1
### Bug fixes
Fix a regression introduced in 8.2.0 where static or async class methods with keyword names fail to parse.8.2.0
### New features
Add support for ES2022 class fields and private methods.8.1.1
### Various
Stop shipping source maps in the NPM package.8.1.0
### Bug fixes
Fix a spurious error in nested destructuring arrays.
### New features
Expose `allowAwaitOutsideFunction` in CLI interface.
Make `allowImportExportAnywhere` also apply to `import.meta`.8.0.5
### Bug fixes
Adjust package.json to work with Node 12.16.0 and 13.0-13.6.8.0.4
### Bug fixes
Make `await x ** y` an error, following the spec.
Fix potentially exponential regular expression.8.0.3
### Bug fixes
Fix a wasteful loop during `Parser` creation when setting `ecmaVersion` to `"latest"`.8.0.2
### Bug fixes
Make the TypeScript types reflect the current allowed values for `ecmaVersion`.
Fix another regexp/division tokenizer issue.8.0.1
### Bug fixes
Provide the correct value in the `version` export.8.0.0
### Bug fixes
Disallow expressions like `(a = b) = c`.
Make non-octal escape sequences a syntax error in strict mode.
### New features
The package can now be loaded directly as an ECMAScript module in node 13+.
Update to the set of Unicode properties from ES2021.
### Breaking changes
The `ecmaVersion` option is now required. For the moment, omitting it will still work with a warning, but that will change in a future release.
Some changes to method signatures that may be used by plugins.자주 묻는 질문
acorn을(를) 7에서 8(으)로 업그레이드할 때 호환성이 깨지는 변경은 무엇인가요?
acorn 7.4.1과 8.18.0 사이에서 Vigia는 삭제된 export 8개, 변경된 시그니처 6개, 삭제되거나 변경된 클래스·인터페이스 멤버 26개를 찾았습니다.
acorn 8에서 지원 중단된 것은 무엇인가요?
acorn 8.18.0에서 export 또는 멤버 0개가 새로 지원 중단으로 표시되었습니다.
에이전트용
GET https://vigia.coredls.cloud/v1/packages/npm/acorn/upgrade?from=7.4.1&to=8.18.0