import * as Shift from 'shift-ast'; import Modification from '../../modification'; export default class DeadBranchRemover extends Modification { /** * Creates a new modification. * @param ast The AST. */ constructor(ast: Shift.Script | Shift.Module); /** * Executes the modification. */ execute(): void; /** * Removes dead branches within an AST node. * @param node The AST node. */ private removeBranches; /** * Attempts to get the body from a node, otherwise just returns the * node itself. * @param node The AST node. * @returns The body of the node. */ private getBody; /** * Returns whether a node is an if statement containing a dead branch. * @param node The AST node. * @returns Whether. */ private isFixedIfStatement; /** * Returns whether a node is a conditional expression containing a dead * branch. * @param node The AST node. * @returns Whether. */ private isFixedConditional; }