Skip to content

Commit d265677

Browse files
committed
chore(*): adds or fixes closure type annotations
This change resolves all warnings found by the closure compiler when verbose mode is turned on and all the other flags remain at defaults. Part of this commit contains code contributed by Ben McCann via PR angular#1710.
1 parent fe803e5 commit d265677

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

56 files changed

+2264
-1456
lines changed

Rakefile

+5-1
Original file line numberDiff line numberDiff line change
@@ -157,12 +157,16 @@ task :minify_angular2 => [:minify_angular] do
157157
input_path = path_to('angular.min.js')
158158
output_path = path_to('angular.min2.js')
159159

160+
161+
# TODO(i): remove rather than suppress bogus warnings
160162
%x(java \
161163
#{java32flags()} \
162164
-jar lib/closure-compiler/compiler.jar \
163165
--compilation_level SIMPLE_OPTIMIZATIONS \
164166
--language_in ECMASCRIPT5_STRICT \
165167
--externs lib/externs/json.js \
168+
--jscomp_off suspiciousCode \
169+
--warning_level QUIET \
166170
--js #{input_path} \
167171
--js_output_file #{output_path})
168172

@@ -339,7 +343,7 @@ def gen_css(cssFile, minify = false)
339343
css.gsub! /'/, "\\\\'"
340344
css.gsub! /\n/, "\\n"
341345

342-
return %Q{angular.element(document).find('head').append('<style type="text/css">#{css}</style>');}
346+
return %Q{window.angular.element(document).find('head').append('<style type="text/css">#{css}</style>');}
343347
end
344348

345349

example/personalLog/personalLog.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ app.controller('LogCtrl', ['$cookieStore', '$scope', function LogCtrl($cookieSto
4646

4747
/**
4848
* Persistently removes a log from logs.
49-
* @param {object} log The log to remove.
49+
* @param {Object} log The log to remove.
5050
*/
5151
$scope.rmLog = function(log) {
5252
for ( var i = 0; i < logs.length; i++) {

0 commit comments

Comments
 (0)