| | |
| | | |
| | | let result; |
| | | try { |
| | | result = await minify(files, options); |
| | | result = await minify(files, options, fs); |
| | | } catch (ex) { |
| | | if (ex.name == "SyntaxError") { |
| | | print_error("Parse error at " + ex.filename + ":" + ex.line + "," + ex.col); |
| | |
| | | }, 2)); |
| | | } else if (program.output == "spidermonkey") { |
| | | try { |
| | | const minified = await minify(result.code, { |
| | | compress: false, |
| | | mangle: false, |
| | | format: { |
| | | ast: true, |
| | | code: false |
| | | } |
| | | }); |
| | | const minified = await minify( |
| | | result.code, |
| | | { |
| | | compress: false, |
| | | mangle: false, |
| | | format: { |
| | | ast: true, |
| | | code: false |
| | | } |
| | | }, |
| | | fs |
| | | ); |
| | | console.log(JSON.stringify(minified.ast.to_mozilla_ast(), null, 2)); |
| | | } catch (ex) { |
| | | fatal(ex); |