| OLD | NEW | 
|---|
| (Empty) |  | 
|  | 1 # Copyright 2016 The Chromium Authors. All rights reserved. | 
|  | 2 # Use of this source code is governed by a BSD-style license that can be | 
|  | 3 # found in the LICENSE file. | 
|  | 4 | 
|  | 5 import("//third_party/closure_compiler/closure_args.gni") | 
|  | 6 | 
|  | 7 closure_compiler_dir = "//third_party/closure_compiler" | 
|  | 8 | 
|  | 9 template("compile_js2_foreach") { | 
|  | 10   action_foreach(target_name) { | 
|  | 11     sources = invoker.sources | 
|  | 12     script = "$closure_compiler_dir/compile2.py" | 
|  | 13     output_name = | 
|  | 14         "{{source_gen_dir}}/closure_${target_name}/{{source_file_part}}" | 
|  | 15     outputs = [ | 
|  | 16       output_name, | 
|  | 17     ] | 
|  | 18     closure_args = common_closure_args | 
|  | 19 | 
|  | 20     if (defined(invoker.strip_whitespace) && invoker.strip_whitespace) { | 
|  | 21       closure_args += [ "compilation_level=WHITESPACE_ONLY" ] | 
|  | 22     } else { | 
|  | 23       closure_args += | 
|  | 24           typecheck_closure_args + [ "compilation_level=SIMPLE_OPTIMIZATIONS" ] | 
|  | 25     } | 
|  | 26 | 
|  | 27     args = [ | 
|  | 28              "{{source}}", | 
|  | 29              "--out_file", | 
|  | 30              rebase_path("$root_out_dir/$output_name"), | 
|  | 31              "--closure_args", | 
|  | 32            ] + closure_args + default_disabled_closure_args | 
|  | 33     deps = invoker.deps | 
|  | 34   } | 
|  | 35 } | 
| OLD | NEW | 
|---|