How to use the uglify-js-papandreou.AST_Call 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
}
                            seenComments.push(comment);
                        }
                    }, this);
                }
            }, this);

            // Detect global 'use strict' directives
            if (parentNode === this.parseTree &&
                node instanceof uglifyJs.AST_Directive &&
                node.value === 'use strict') {
                this.strict = true;
            }

            if (node instanceof uglifyJs.AST_SimpleStatement &&
                node.body instanceof uglifyJs.AST_Call &&
                node.body.expression instanceof uglifyJs.AST_Dot &&
                node.body.expression.property === 'config' &&
                node.body.expression.expression instanceof uglifyJs.AST_SymbolRef &&
                node.body.args[0] instanceof uglifyJs.AST_Object &&
                (node.body.expression.expression.name === 'require' || node.body.expression.expression.name === 'requirejs')) {

                outgoingRelations.push(new AssetGraph.JavaScriptRequireJsConfig({
                    from: this,
                    node: node.body.args[0],
                    parentNode: node.body,
                    to: new AssetGraph.RequireJsConfig({
                        parseTree: node.body.args[0].transform(deepCloneTransform)
                    })
                }));
            } else if (node instanceof uglifyJs.AST_Var) {
                node.definitions.forEach(function (varDefNode) {
github assetgraph / assetgraph / lib / assets / JavaScript.js View on Github external
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,
                                    to: {
                                        url: node.args[0].value
                                    },
                                    node: node
                                }));
                            } else {
                                syntaxErrors.push(new errors.SyntaxError({
                                    message: 'Invalid GETTEXT syntax: ' + node.print_to_string(),
                                    asset: this
                                }));
                            }