How to use the uglify-js-papandreou.AST_Seq function in uglify-js-papandreou

To help you get started, we’ve selected a few uglify-js-papandreou examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github assetgraph / assetgraph / lib / assets / JavaScript.js View on Github external
}
                        diveIntoAngularMethodCall(argumentNodes, templateCacheVariableName);
                        stackPosition -= 2;
                    }
                }

                if (node.expression instanceof uglifyJs.AST_Symbol && node.expression.name === 'INCLUDE') {
                    if (node.args.length === 1 && node.args[0] instanceof uglifyJs.AST_String) {
                        outgoingRelations.push(new AssetGraph.JavaScriptInclude({
                            from: this,
                            to: {
                                url: node.args[0].value
                            },
                            node: node,
                            detachableNode: parentNode instanceof uglifyJs.AST_Seq ? node : parentNode,
                            parentNode: parentNode instanceof uglifyJs.AST_Seq ? parentNode : parentParentNode
                        }));
                    } else {
                        syntaxErrors.push(new errors.SyntaxError({
                            message: 'Invalid INCLUDE syntax: Must take a single string argument:' + node.print_to_string(),
                            asset: this
                        }));
                    }
                } else if (node.expression instanceof uglifyJs.AST_Symbol && node.expression.name === 'GETTEXT') {
                    if (node.args.length === 1) {
                        // TRHTML(GETTEXT(...)) is covered by TRHTML below:
                        if (!(parentNode instanceof uglifyJs.AST_Call) || !(parentNode.expression instanceof uglifyJs.AST_Symbol) || parentNode.expression.name !== 'TRHTML') {
                            node.args[0] = tryFoldConstantToString(node.args[0]);
                            if (node.args[0] instanceof uglifyJs.AST_String) {
                                outgoingRelations.push(new AssetGraph.JavaScriptGetText({
                                    parentNode: parentNode,
                                    from: this,
github assetgraph / assetgraph / lib / assets / JavaScript.js View on Github external
} else if (seenDefine && isNamedDefineNode(_node)) {
                                isSucceededByDefineWithStringArg = true;
                            }
                        };
                    OUTER:
                    while (parentIndex >= 0) {
                        if (stack[parentIndex] instanceof uglifyJs.AST_Block) {
                            var blockNode = stack[parentIndex];
                            for (var i = blockNode.body.indexOf(stack[parentIndex + 1]) ; i < blockNode.body.length ; i += 1) {
                                if (blockNode.body[i] instanceof uglifyJs.AST_SimpleStatement && isNamedDefineNode(blockNode.body[i].body)) {
                                    isSucceededByDefineWithStringArg = true;
                                    break OUTER;
                                }
                            }
                            break OUTER;
                        } else if (stack[parentIndex] instanceof uglifyJs.AST_Seq) {
                            stack[parentIndex].walk(new uglifyJs.TreeWalker(walkFn));
                            break OUTER;
                        } else {
                            parentIndex -= 1;
                        }
                    }

                    if (!isSucceededByDefineWithStringArg) {
                        var arrayNode = node.args[0];
                        arrayNode.elements.forEach(function (arrayItemAst, i) {
                            arrayItemAst = arrayNode.elements[i] = tryFoldConstantToString(arrayItemAst);
                            if (arrayItemAst instanceof uglifyJs.AST_String) {
                                if (['require', 'exports', 'module'].indexOf(arrayItemAst.value) === -1) {
                                    outgoingRelations.push(new AssetGraph.JavaScriptAmdRequire({
                                        from: this,
                                        callNode: node,