Skip to content

Commit f2fab49

Browse files
committed
style: make jshint happy
1 parent 934a95d commit f2fab49

File tree

304 files changed

+1951
-1187
lines changed

Some content is hidden

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

304 files changed

+1951
-1187
lines changed

i18n/src/closureI18nExtractor.js

+1
Original file line numberDiff line numberDiff line change
@@ -159,6 +159,7 @@ function outputLocale(localeInfo, localeID) {
159159
localeObj.id = correctedLocaleId(localeID);
160160

161161
var prefix =
162+
"'use strict';\n" +
162163
'angular.module("ngLocale", [], ["$provide", function($provide) {\n' +
163164
'var PLURAL_CATEGORY = {' +
164165
'ZERO: "zero", ONE: "one", TWO: "two", FEW: "few", MANY: "many", OTHER: "other"' +

src/Angular.js

+114-20
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,88 @@
11
'use strict';
22

3+
/* We need to tell jshint what variables are being exported */
4+
/* global
5+
-angular,
6+
-msie,
7+
-jqLite,
8+
-jQuery,
9+
-slice,
10+
-push,
11+
-toString,
12+
-ngMinErr,
13+
-_angular,
14+
-angularModule,
15+
-nodeName_,
16+
-uid,
17+
18+
-lowercase,
19+
-uppercase,
20+
-manualLowercase,
21+
-manualUppercase,
22+
-nodeName_,
23+
-isArrayLike,
24+
-forEach,
25+
-sortedKeys,
26+
-forEachSorted,
27+
-reverseParams,
28+
-nextUid,
29+
-setHashKey,
30+
-extend,
31+
-int,
32+
-inherit,
33+
-noop,
34+
-identity,
35+
-valueFn,
36+
-isUndefined,
37+
-isDefined,
38+
-isObject,
39+
-isString,
40+
-isNumber,
41+
-isDate,
42+
-isArray,
43+
-isFunction,
44+
-isRegExp,
45+
-isWindow,
46+
-isScope,
47+
-isFile,
48+
-isBoolean,
49+
-trim,
50+
-isElement,
51+
-makeMap,
52+
-map,
53+
-size,
54+
-includes,
55+
-indexOf,
56+
-arrayRemove,
57+
-isLeafNode,
58+
-copy,
59+
-shallowCopy,
60+
-equals,
61+
-csp,
62+
-concat,
63+
-sliceArgs,
64+
-bind,
65+
-toJsonReplacer,
66+
-toJson,
67+
-fromJson,
68+
-toBoolean,
69+
-startingTag,
70+
-tryDecodeURIComponent,
71+
-parseKeyValue,
72+
-toKeyValue,
73+
-encodeUriSegment,
74+
-encodeUriQuery,
75+
-angularInit,
76+
-bootstrap,
77+
-snake_case,
78+
-bindJQuery,
79+
-assertArg,
80+
-assertArgFn,
81+
-assertNotHasOwnProperty,
82+
-getter
83+
84+
*/
85+
386
////////////////////////////////////
487

588
/**
@@ -27,11 +110,13 @@ var uppercase = function(string){return isString(string) ? string.toUpperCase()
27110

28111

29112
var manualLowercase = function(s) {
113+
/* jshint bitwise: false */
30114
return isString(s)
31115
? s.replace(/[A-Z]/g, function(ch) {return String.fromCharCode(ch.charCodeAt(0) | 32);})
32116
: s;
33117
};
34118
var manualUppercase = function(s) {
119+
/* jshint bitwise: false */
35120
return isString(s)
36121
? s.replace(/[a-z]/g, function(ch) {return String.fromCharCode(ch.charCodeAt(0) & ~32);})
37122
: s;
@@ -77,7 +162,8 @@ if (isNaN(msie)) {
77162
/**
78163
* @private
79164
* @param {*} obj
80-
* @return {boolean} Returns true if `obj` is an array or array-like object (NodeList, Arguments, String ...)
165+
* @return {boolean} Returns true if `obj` is an array or array-like object (NodeList, Arguments,
166+
* String ...)
81167
*/
82168
function isArrayLike(obj) {
83169
if (obj == null || isWindow(obj)) {
@@ -171,7 +257,7 @@ function forEachSorted(obj, iterator, context) {
171257
* @returns {function(*, string)}
172258
*/
173259
function reverseParams(iteratorFn) {
174-
return function(value, key) { iteratorFn(key, value) };
260+
return function(value, key) { iteratorFn(key, value); };
175261
}
176262

177263
/**
@@ -530,17 +616,17 @@ function map(obj, iterator, context) {
530616
* @returns {number} The size of `obj` or `0` if `obj` is neither an object nor an array.
531617
*/
532618
function size(obj, ownPropsOnly) {
533-
var size = 0, key;
619+
var count = 0, key;
534620

535621
if (isArray(obj) || isString(obj)) {
536622
return obj.length;
537623
} else if (isObject(obj)){
538624
for (key in obj)
539625
if (!ownPropsOnly || obj.hasOwnProperty(key))
540-
size++;
626+
count++;
541627
}
542628

543-
return size;
629+
return count;
544630
}
545631

546632

@@ -637,7 +723,8 @@ function isLeafNode (node) {
637723
*/
638724
function copy(source, destination){
639725
if (isWindow(source) || isScope(source)) {
640-
throw ngMinErr('cpws', "Can't copy! Making copies of Window or Scope instances is not supported.");
726+
throw ngMinErr('cpws',
727+
"Can't copy! Making copies of Window or Scope instances is not supported.");
641728
}
642729

643730
if (!destination) {
@@ -654,7 +741,8 @@ function copy(source, destination){
654741
}
655742
}
656743
} else {
657-
if (source === destination) throw ngMinErr('cpi', "Can't copy! Source and destination are identical.");
744+
if (source === destination) throw ngMinErr('cpi',
745+
"Can't copy! Source and destination are identical.");
658746
if (isArray(source)) {
659747
destination.length = 0;
660748
for ( var i = 0; i < source.length; i++) {
@@ -698,8 +786,8 @@ function shallowCopy(src, dst) {
698786
* @function
699787
*
700788
* @description
701-
* Determines if two objects or two values are equivalent. Supports value types, regular expressions, arrays and
702-
* objects.
789+
* Determines if two objects or two values are equivalent. Supports value types, regular
790+
* expressions, arrays and objects.
703791
*
704792
* Two objects or values are considered equivalent if at least one of the following is true:
705793
*
@@ -776,6 +864,7 @@ function sliceArgs(args, startIndex) {
776864
}
777865

778866

867+
/* jshint -W101 */
779868
/**
780869
* @ngdoc function
781870
* @name angular.bind
@@ -784,14 +873,15 @@ function sliceArgs(args, startIndex) {
784873
* @description
785874
* Returns a function which calls function `fn` bound to `self` (`self` becomes the `this` for
786875
* `fn`). You can supply optional `args` that are prebound to the function. This feature is also
787-
* known as [partial application](http://en.wikipedia.org/wiki/Partial_application), as distinguished
788-
* from [function currying](http://en.wikipedia.org/wiki/Currying#Contrast_with_partial_function_application).
876+
* known as [partial application](http://en.wikipedia.org/wiki/Partial_application), as
877+
* distinguished from [function currying](http://en.wikipedia.org/wiki/Currying#Contrast_with_partial_function_application).
789878
*
790879
* @param {Object} self Context which `fn` should be evaluated in.
791880
* @param {function()} fn Function to be bound.
792881
* @param {...*} args Optional arguments to be prebound to the `fn` function call.
793882
* @returns {function()} Function that wraps the `fn` with all the specified bindings.
794883
*/
884+
/* jshint +W101 */
795885
function bind(self, fn) {
796886
var curryArgs = arguments.length > 2 ? sliceArgs(arguments, 2) : [];
797887
if (isFunction(fn) && !(fn instanceof RegExp)) {
@@ -951,10 +1041,12 @@ function toKeyValue(obj) {
9511041
forEach(obj, function(value, key) {
9521042
if (isArray(value)) {
9531043
forEach(value, function(arrayValue) {
954-
parts.push(encodeUriQuery(key, true) + (arrayValue === true ? '' : '=' + encodeUriQuery(arrayValue, true)));
1044+
parts.push(encodeUriQuery(key, true) +
1045+
(arrayValue === true ? '' : '=' + encodeUriQuery(arrayValue, true)));
9551046
});
9561047
} else {
957-
parts.push(encodeUriQuery(key, true) + (value === true ? '' : '=' + encodeUriQuery(value, true)));
1048+
parts.push(encodeUriQuery(key, true) +
1049+
(value === true ? '' : '=' + encodeUriQuery(value, true)));
9581050
}
9591051
});
9601052
return parts.length ? parts.join('&') : '';
@@ -1016,8 +1108,8 @@ function encodeUriQuery(val, pctEncodeSpaces) {
10161108
* designates the root of the application and is typically placed
10171109
* at the root of the page.
10181110
*
1019-
* The first ngApp found in the document will be auto-bootstrapped. To use multiple applications in an
1020-
* HTML document you must manually bootstrap them using {@link angular.bootstrap}.
1111+
* The first ngApp found in the document will be auto-bootstrapped. To use multiple applications in
1112+
* an HTML document you must manually bootstrap them using {@link angular.bootstrap}.
10211113
* Applications cannot be nested.
10221114
*
10231115
* In the example below if the `ngApp` directive were not placed
@@ -1091,7 +1183,8 @@ function angularInit(element, bootstrap) {
10911183
* @param {Element} element DOM element which is the root of angular application.
10921184
* @param {Array<String|Function|Array>=} modules an array of modules to load into the application.
10931185
* Each item in the array should be the name of a predefined module or a (DI annotated)
1094-
* function that will be invoked by the injector as a run block. See: {@link angular.module modules}
1186+
* function that will be invoked by the injector as a run block.
1187+
* See: {@link angular.module modules}
10951188
* @returns {AUTO.$injector} Returns the newly created injector for this app.
10961189
*/
10971190
function bootstrap(element, modules) {
@@ -1156,10 +1249,11 @@ function bindJQuery() {
11561249
injector: JQLitePrototype.injector,
11571250
inheritedData: JQLitePrototype.inheritedData
11581251
});
1159-
// Method signature: JQLitePatchJQueryRemove(name, dispatchThis, filterElems, getterIfNoArguments)
1160-
JQLitePatchJQueryRemove('remove', true, true, false);
1161-
JQLitePatchJQueryRemove('empty', false, false, false);
1162-
JQLitePatchJQueryRemove('html', false, false, true);
1252+
// Method signature:
1253+
// jqLitePatchJQueryRemove(name, dispatchThis, filterElems, getterIfNoArguments)
1254+
jqLitePatchJQueryRemove('remove', true, true, false);
1255+
jqLitePatchJQueryRemove('empty', false, false, false);
1256+
jqLitePatchJQueryRemove('html', false, false, true);
11631257
} else {
11641258
jqLite = JQLite;
11651259
}

src/AngularPublic.js

100755100644
+74
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,79 @@
11
'use strict';
22

3+
/* global
4+
angularModule: true,
5+
version: true,
6+
7+
$LocaleProvider,
8+
$CompileProvider,
9+
10+
htmlAnchorDirective,
11+
inputDirective,
12+
inputDirective,
13+
formDirective,
14+
scriptDirective,
15+
selectDirective,
16+
styleDirective,
17+
optionDirective,
18+
ngBindDirective,
19+
ngBindHtmlDirective,
20+
ngBindTemplateDirective,
21+
ngClassDirective,
22+
ngClassEvenDirective,
23+
ngClassOddDirective,
24+
ngCspDirective,
25+
ngCloakDirective,
26+
ngControllerDirective,
27+
ngFormDirective,
28+
ngHideDirective,
29+
ngIfDirective,
30+
ngIncludeDirective,
31+
ngInitDirective,
32+
ngNonBindableDirective,
33+
ngPluralizeDirective,
34+
ngRepeatDirective,
35+
ngShowDirective,
36+
ngStyleDirective,
37+
ngSwitchDirective,
38+
ngSwitchWhenDirective,
39+
ngSwitchDefaultDirective,
40+
ngOptionsDirective,
41+
ngTranscludeDirective,
42+
ngModelDirective,
43+
ngListDirective,
44+
ngChangeDirective,
45+
requiredDirective,
46+
requiredDirective,
47+
ngValueDirective,
48+
ngAttributeAliasDirectives,
49+
ngEventDirectives,
50+
51+
$AnchorScrollProvider,
52+
$AnimateProvider,
53+
$BrowserProvider,
54+
$CacheFactoryProvider,
55+
$ControllerProvider,
56+
$DocumentProvider,
57+
$ExceptionHandlerProvider,
58+
$FilterProvider,
59+
$InterpolateProvider,
60+
$IntervalProvider,
61+
$HttpProvider,
62+
$HttpBackendProvider,
63+
$LocationProvider,
64+
$LogProvider,
65+
$ParseProvider,
66+
$RootScopeProvider,
67+
$QProvider,
68+
$SceProvider,
69+
$SceDelegateProvider,
70+
$SnifferProvider,
71+
$TemplateCacheProvider,
72+
$TimeoutProvider,
73+
$WindowProvider
74+
*/
75+
76+
377
/**
478
* @ngdoc property
579
* @name angular.version

0 commit comments

Comments
 (0)