How to use the uglify-js-papandreou.AST_String 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
parentNode: node
                                        }));
                                    }
                                }, this);
                            } else if (node instanceof uglifyJs.AST_SimpleStatement) {
                                if (parentNode instanceof uglifyJs.AST_Function) {
                                    // Use the statements array of the function instead:
                                    parentNode = parentNode.body;
                                }
                                if (node.body instanceof uglifyJs.AST_Call &&
                                    node.body.expression instanceof uglifyJs.AST_Dot &&
                                    node.body.expression.property === 'put' &&
                                    node.body.expression.expression instanceof uglifyJs.AST_SymbolRef &&
                                    node.body.expression.expression.name === templateCacheVariableName &&
                                    node.body.args.length === 2 &&
                                    node.body.args[0] instanceof uglifyJs.AST_String &&
                                    node.body.args[1] instanceof uglifyJs.AST_String) {

                                    outgoingRelations.push(new AssetGraph.JavaScriptAngularJsTemplateCacheAssignment({
                                        from: this,
                                        to: new AssetGraph.Html({
                                            isExternalizable: false,
                                            text: node.body.args[1].value
                                        }),
                                        node: node,
                                        parentNode: parentNode
                                    }));
                                }
                            }
                        }.bind(this));
                        argumentNodes.forEach(function (argumentNode) {
github assetgraph / assetgraph / lib / assets / JavaScript.js View on Github external
node.properties.forEach(function (keyValue) {
                                    if (keyValue.key === 'templateUrl' && keyValue.value instanceof uglifyJs.AST_String) {
                                        outgoingRelations.push(new AssetGraph.JavaScriptAngularJsTemplate({
                                            from: this,
                                            to: {
                                                type: 'Html',
                                                url: keyValue.value.value
                                            },
                                            node: keyValue,
                                            parentNode: node
                                        }));
                                    } else if (keyValue.key === 'template' && keyValue.value instanceof uglifyJs.AST_String) {
                                        outgoingRelations.push(new AssetGraph.JavaScriptAngularJsTemplate({
                                            from: this,
                                            to: new AssetGraph.Html({
                                                text: keyValue.value.value
                                            }),
                                            node: keyValue,
                                            parentNode: node
                                        }));
                                    }
                                }, this);
                            } else if (node instanceof uglifyJs.AST_SimpleStatement) {