pruneFuncReferences(pruneList) {
        var engine = this;

        estraverse.replace(this.ast, {
            enter: function (node, parent) {
                if (node.type === 'FunctionDeclaration' && node.id.name in pruneList) {
                    if (engine.keep_comments) {
                        engine.moveAllCommentsToSiblings(node, parent);
                    }

                    engine.changed = true;
                    this.remove();
                } else if (node.type === 'VariableDeclarator' && node.id.name in pruneList) {
                    engine.changed = true;
                    this.remove();
                } else if (node.type === 'CallExpression' && node.callee.name in pruneList) {
                    if (pruneList[node.callee.name]) {
                        engine.changed = true;
                        return engine.trueLiteral();
                    } else {
                        engine.changed = true;
                        return engine.falseLiteral();
                    }
                }
            },

            leave: function (node, parent) {
                if (node.type === 'VariableDeclaration' && node.declarations.length === 0) {
                    engine.preserveCommentsBasedOnOption(node, parent, engine.keep_comments);
                    engine.changed = true;
                    this.remove();
                }
            },

            fallback: 'iteration',
        });

        return engine.changed;
    }
// replace all calls to the functions with the corresponding literals
replace all calls to the functions with the corresponding literals
replace all calls to the functions with the corresponding literals
pruneFuncReferences(pruneList) {
        var engine = this;
        estraverse.replace(this.ast, {
            enter: function (node, parent) {
                if (node.type === 'FunctionDeclaration' && node.id.name in pruneList) {
                    if (engine.keep_comments) {
                        engine.moveAllCommentsToSiblings(node, parent);
                    }
                    engine.changed = true;
                    this.remove();
                } else if (node.type === 'VariableDeclarator' && node.id.name in pruneList) {
                    engine.changed = true;
                    this.remove();
                } else if (node.type === 'CallExpression' && node.callee.name in pruneList) {
                    if (pruneList[node.callee.name]) {
                        engine.changed = true;
                        return engine.trueLiteral();
                    } else {
                        engine.changed = true;
                        return engine.falseLiteral();
                    }
                }
            },
            leave: function (node, parent) {
                if (node.type === 'VariableDeclaration' && node.declarations.length === 0) {
                    engine.preserveCommentsBasedOnOption(node, parent, engine.keep_comments);
                    engine.changed = true;
                    this.remove();
                }
            },
            fallback: 'iteration',
        });
        return engine.changed;
    }
pruneFuncReferences ( pruneList ) { var engine = this ; estraverse . replace ( this . ast , { enter : function ( node , parent ) { if ( node . type === 'FunctionDeclaration' && node . id . name in pruneList ) { if ( engine . keep_comments ) { engine . moveAllCommentsToSiblings ( node , parent ) ; } engine . changed = true ; this . remove ( ) ; } else if ( node . type === 'VariableDeclarator' && node . id . name in pruneList ) { engine . changed = true ; this . remove ( ) ; } else if ( node . type === 'CallExpression' && node . callee . name in pruneList ) { if ( pruneList [ node . callee . name ] ) { engine . changed = true ; return engine . trueLiteral ( ) ; } else { engine . changed = true ; return engine . falseLiteral ( ) ; } } } , leave : function ( node , parent ) { if ( node . type === 'VariableDeclaration' && node . declarations . length === 0 ) { engine . preserveCommentsBasedOnOption ( node , parent , engine . keep_comments ) ; engine . changed = true ; this . remove ( ) ; } } , fallback : 'iteration' , } ) ; return engine . changed ; }
replace all calls to the functions with the corresponding literals
replace all calls to the functions with the corresponding literals