def minify(text, mangle=False, mangle_toplevel=False): parser = Parser() tree = parser.parse(text) if mangle: mangler.mangle(tree, toplevel=mangle_toplevel) minified = ECMAMinifier().visit(tree) return minified
def minify(text, mangle=False): parser = Parser() tree = parser.parse(text) if mangle: mangler.mangle(tree) minified = ECMAMinifier().visit(tree) return minified
def test_func(self): parser = Parser() tree = parser.parse(input) mangle(tree, toplevel=True) self.assertMultiLineEqual( textwrap.dedent(tree.to_ecma()).strip(), textwrap.dedent(expected).strip())
def test_func(self): parser = Parser() tree = parser.parse(input) mangle(tree, toplevel=True) self.assertMultiLineEqual( textwrap.dedent(tree.to_ecma()).strip(), textwrap.dedent(expected).strip() )