1 # Copyright 2015 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.
5 # This file should be identical to js_compile.gypi except it passes jscomp_error
6 # flags to the compiler. One should prefer this over js_compile.gypi once the
7 # JS code being compiled are error free.
9 # This file should be eventually deprecated in favor of
10 # third_party/closure_compiler/compile_js.gypi once they have the same set of
11 # jscomp_error flags enabled. See http://crbug.com/487804
14 'closure_compiler_path': '<(DEPTH)/third_party/closure_compiler/compiler/compiler.jar',
15 'compile_javascript%': 1,
18 ['compile_javascript==1', {
21 'rule_name': 'jscompilation',
24 '<(closure_compiler_path)',
27 '<(SHARED_INTERMEDIATE_DIR)/<(RULE_INPUT_NAME)',
32 '<(closure_compiler_path)',
33 '--compilation_level',
34 'SIMPLE_OPTIMIZATIONS',
35 '--jscomp_error=accessControls',
36 '--jscomp_error=ambiguousFunctionDecl',
37 # '--jscomp_error=checkTypes',
38 # '--jscomp_error=checkVars',
39 '--jscomp_error=constantProperty',
40 '--jscomp_error=deprecated',
41 '--jscomp_error=externsValidation',
42 '--jscomp_error=globalThis',
43 '--jscomp_error=invalidCasts',
44 # '--jscomp_error=missingProperties',
45 # '--jscomp_error=missingReturn',
46 '--jscomp_error=nonStandardJsDocs',
47 '--jscomp_error=suspiciousCode',
48 '--jscomp_error=undefinedNames',
49 # '--jscomp_error=undefinedVars',
50 '--jscomp_error=unknownDefines',
51 '--jscomp_error=uselessCode',
52 '--jscomp_error=visibility',
58 'message': 'Running closure compiler on <(RULE_INPUT_NAME)',
59 } # rule_name: jscompilation
64 'rule_name': 'jscompilation',
67 '<(SHARED_INTERMEDIATE_DIR)/<(RULE_INPUT_NAME)',
75 ]} # rule_name: jscompilation
76 ] # condition: compile_javascript