1
1
'use strict' ;
2
2
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
+
3
86
////////////////////////////////////
4
87
5
88
/**
@@ -27,11 +110,13 @@ var uppercase = function(string){return isString(string) ? string.toUpperCase()
27
110
28
111
29
112
var manualLowercase = function ( s ) {
113
+ /* jshint bitwise: false */
30
114
return isString ( s )
31
115
? s . replace ( / [ A - Z ] / g, function ( ch ) { return String . fromCharCode ( ch . charCodeAt ( 0 ) | 32 ) ; } )
32
116
: s ;
33
117
} ;
34
118
var manualUppercase = function ( s ) {
119
+ /* jshint bitwise: false */
35
120
return isString ( s )
36
121
? s . replace ( / [ a - z ] / g, function ( ch ) { return String . fromCharCode ( ch . charCodeAt ( 0 ) & ~ 32 ) ; } )
37
122
: s ;
@@ -77,7 +162,8 @@ if (isNaN(msie)) {
77
162
/**
78
163
* @private
79
164
* @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 ...)
81
167
*/
82
168
function isArrayLike ( obj ) {
83
169
if ( obj == null || isWindow ( obj ) ) {
@@ -171,7 +257,7 @@ function forEachSorted(obj, iterator, context) {
171
257
* @returns {function(*, string) }
172
258
*/
173
259
function reverseParams ( iteratorFn ) {
174
- return function ( value , key ) { iteratorFn ( key , value ) } ;
260
+ return function ( value , key ) { iteratorFn ( key , value ) ; } ;
175
261
}
176
262
177
263
/**
@@ -530,17 +616,17 @@ function map(obj, iterator, context) {
530
616
* @returns {number } The size of `obj` or `0` if `obj` is neither an object nor an array.
531
617
*/
532
618
function size ( obj , ownPropsOnly ) {
533
- var size = 0 , key ;
619
+ var count = 0 , key ;
534
620
535
621
if ( isArray ( obj ) || isString ( obj ) ) {
536
622
return obj . length ;
537
623
} else if ( isObject ( obj ) ) {
538
624
for ( key in obj )
539
625
if ( ! ownPropsOnly || obj . hasOwnProperty ( key ) )
540
- size ++ ;
626
+ count ++ ;
541
627
}
542
628
543
- return size ;
629
+ return count ;
544
630
}
545
631
546
632
@@ -637,7 +723,8 @@ function isLeafNode (node) {
637
723
*/
638
724
function copy ( source , destination ) {
639
725
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." ) ;
641
728
}
642
729
643
730
if ( ! destination ) {
@@ -654,7 +741,8 @@ function copy(source, destination){
654
741
}
655
742
}
656
743
} 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." ) ;
658
746
if ( isArray ( source ) ) {
659
747
destination . length = 0 ;
660
748
for ( var i = 0 ; i < source . length ; i ++ ) {
@@ -698,8 +786,8 @@ function shallowCopy(src, dst) {
698
786
* @function
699
787
*
700
788
* @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.
703
791
*
704
792
* Two objects or values are considered equivalent if at least one of the following is true:
705
793
*
@@ -776,6 +864,7 @@ function sliceArgs(args, startIndex) {
776
864
}
777
865
778
866
867
+ /* jshint -W101 */
779
868
/**
780
869
* @ngdoc function
781
870
* @name angular.bind
@@ -784,14 +873,15 @@ function sliceArgs(args, startIndex) {
784
873
* @description
785
874
* Returns a function which calls function `fn` bound to `self` (`self` becomes the `this` for
786
875
* `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).
789
878
*
790
879
* @param {Object } self Context which `fn` should be evaluated in.
791
880
* @param {function() } fn Function to be bound.
792
881
* @param {...* } args Optional arguments to be prebound to the `fn` function call.
793
882
* @returns {function() } Function that wraps the `fn` with all the specified bindings.
794
883
*/
884
+ /* jshint +W101 */
795
885
function bind ( self , fn ) {
796
886
var curryArgs = arguments . length > 2 ? sliceArgs ( arguments , 2 ) : [ ] ;
797
887
if ( isFunction ( fn ) && ! ( fn instanceof RegExp ) ) {
@@ -951,10 +1041,12 @@ function toKeyValue(obj) {
951
1041
forEach ( obj , function ( value , key ) {
952
1042
if ( isArray ( value ) ) {
953
1043
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 ) ) ) ;
955
1046
} ) ;
956
1047
} else {
957
- parts . push ( encodeUriQuery ( key , true ) + ( value === true ? '' : '=' + encodeUriQuery ( value , true ) ) ) ;
1048
+ parts . push ( encodeUriQuery ( key , true ) +
1049
+ ( value === true ? '' : '=' + encodeUriQuery ( value , true ) ) ) ;
958
1050
}
959
1051
} ) ;
960
1052
return parts . length ? parts . join ( '&' ) : '' ;
@@ -1016,8 +1108,8 @@ function encodeUriQuery(val, pctEncodeSpaces) {
1016
1108
* designates the root of the application and is typically placed
1017
1109
* at the root of the page.
1018
1110
*
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}.
1021
1113
* Applications cannot be nested.
1022
1114
*
1023
1115
* In the example below if the `ngApp` directive were not placed
@@ -1091,7 +1183,8 @@ function angularInit(element, bootstrap) {
1091
1183
* @param {Element } element DOM element which is the root of angular application.
1092
1184
* @param {Array<String|Function|Array>= } modules an array of modules to load into the application.
1093
1185
* 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}
1095
1188
* @returns {AUTO.$injector } Returns the newly created injector for this app.
1096
1189
*/
1097
1190
function bootstrap ( element , modules ) {
@@ -1156,10 +1249,11 @@ function bindJQuery() {
1156
1249
injector : JQLitePrototype . injector ,
1157
1250
inheritedData : JQLitePrototype . inheritedData
1158
1251
} ) ;
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 ) ;
1163
1257
} else {
1164
1258
jqLite = JQLite ;
1165
1259
}
0 commit comments