import * as Shift from 'shift-ast'; import Modification from '../../modification'; export default class FunctionExecutor extends Modification { private readonly scopeTypes; private readonly functionTypes; private executedFunctions; private globalScope; private foundExecutedFunction; /** * Creates a new modification. * @param ast The AST. */ constructor(ast: Shift.Script); /** * Executes the modification. */ execute(): void; /** * Finds all the executed functions. */ private findExecutedFunctions; /** * Finds aliases for executed functions. */ private findAliases; /** * Finds and replaces all calls of executed functions. */ private replaceFunctionCalls; /** * Attempts to remove all executed functions. */ private removeFunctions; /** * Attempts to convert a literal value to an AST node. * @param value The literal value. * @returns The AST node or null. */ private literalValueToNode; /** * Returns whether a node is a variable reassignment. * @param node The AST node. * @returns Whether. */ private isVariableReassignment; }