Remove guardedHandlers from ASTs (#9979)

This commit is contained in:
Daniel Tschinder
2019-05-15 03:37:22 -07:00
committed by GitHub
parent 1969e6b6aa
commit 85432e2c44
36 changed files with 3 additions and 41 deletions

View File

@@ -22,10 +22,6 @@ import {
SCOPE_SUPER,
} from "../util/scopeflags";
// Reused empty array added for node fields that are always empty.
const empty = [];
const loopLabel = { kind: "loop" },
switchLabel = { kind: "switch" };
@@ -683,7 +679,6 @@ export default class StatementParser extends ExpressionParser {
node.handler = this.finishNode(clause, "CatchClause");
}
node.guardedHandlers = empty;
node.finalizer = this.eat(tt._finally) ? this.parseBlock() : null;
if (!node.handler && !node.finalizer) {

View File

@@ -263,8 +263,6 @@ export type TryStatement = NodeBase & {
block: BlockStatement,
handler: CatchClause | null,
finalizer: BlockStatement | null,
guardedHandlers: $ReadOnlyArray<empty>, // TODO: Not in spec
};
export type CatchClause = NodeBase & {