2
2
3
3
////////////////////////////////////
4
4
5
- if ( typeof document . getAttribute == $ undefined)
5
+ if ( typeof document . getAttribute == ' undefined' )
6
6
document . getAttribute = function ( ) { } ;
7
7
8
8
/**
@@ -52,14 +52,7 @@ if ('i' !== 'I'.toLowerCase()) {
52
52
function fromCharCode ( code ) { return String . fromCharCode ( code ) ; }
53
53
54
54
55
- var $boolean = 'boolean' ,
56
- $console = 'console' ,
57
- $length = 'length' ,
58
- $name = 'name' ,
59
- $object = 'object' ,
60
- $string = 'string' ,
61
- $undefined = 'undefined' ,
62
- Error = window . Error ,
55
+ var Error = window . Error ,
63
56
/** holds major version number for IE or NaN for real browsers */
64
57
msie = int ( ( / m s i e ( \d + ) / . exec ( lowercase ( navigator . userAgent ) ) || [ ] ) [ 1 ] ) ,
65
58
jqLite , // delay binding since jQuery could be loaded after us.
@@ -107,7 +100,7 @@ function forEach(obj, iterator, context) {
107
100
if ( obj ) {
108
101
if ( isFunction ( obj ) ) {
109
102
for ( key in obj ) {
110
- if ( key != 'prototype' && key != $ length && key != $ name && obj . hasOwnProperty ( key ) ) {
103
+ if ( key != 'prototype' && key != ' length' && key != ' name' && obj . hasOwnProperty ( key ) ) {
111
104
iterator . call ( context , obj [ key ] , key ) ;
112
105
}
113
106
}
@@ -138,7 +131,7 @@ function sortedKeys(obj) {
138
131
}
139
132
140
133
function forEachSorted ( obj , iterator , context ) {
141
- var keys = sortedKeys ( obj )
134
+ var keys = sortedKeys ( obj ) ;
142
135
for ( var i = 0 ; i < keys . length ; i ++ ) {
143
136
iterator . call ( context , obj [ keys [ i ] ] , keys [ i ] ) ;
144
137
}
@@ -269,7 +262,7 @@ function valueFn(value) {return function() {return value;};}
269
262
* @param {* } value Reference to check.
270
263
* @returns {boolean } True if `value` is undefined.
271
264
*/
272
- function isUndefined ( value ) { return typeof value == $ undefined; }
265
+ function isUndefined ( value ) { return typeof value == ' undefined' ; }
273
266
274
267
275
268
/**
@@ -283,7 +276,7 @@ function isUndefined(value){return typeof value == $undefined;}
283
276
* @param {* } value Reference to check.
284
277
* @returns {boolean } True if `value` is defined.
285
278
*/
286
- function isDefined ( value ) { return typeof value != $ undefined; }
279
+ function isDefined ( value ) { return typeof value != ' undefined' ; }
287
280
288
281
289
282
/**
@@ -298,7 +291,7 @@ function isDefined(value){return typeof value != $undefined;}
298
291
* @param {* } value Reference to check.
299
292
* @returns {boolean } True if `value` is an `Object` but not `null`.
300
293
*/
301
- function isObject ( value ) { return value != null && typeof value == $ object; }
294
+ function isObject ( value ) { return value != null && typeof value == ' object' ; }
302
295
303
296
304
297
/**
@@ -312,7 +305,7 @@ function isObject(value){return value!=null && typeof value == $object;}
312
305
* @param {* } value Reference to check.
313
306
* @returns {boolean } True if `value` is a `String`.
314
307
*/
315
- function isString ( value ) { return typeof value == $ string; }
308
+ function isString ( value ) { return typeof value == ' string' ; }
316
309
317
310
318
311
/**
@@ -397,8 +390,10 @@ function isFile(obj) {
397
390
}
398
391
399
392
400
- function isBoolean ( value ) { return typeof value == $boolean ; }
401
- function isTextNode ( node ) { return nodeName_ ( node ) == '#text' ; }
393
+ function isBoolean ( value ) {
394
+ return typeof value == 'boolean' ;
395
+ }
396
+
402
397
403
398
function trim ( value ) {
404
399
return isString ( value ) ? value . replace ( / ^ \s * / , '' ) . replace ( / \s * $ / , '' ) : value ;
@@ -433,26 +428,6 @@ function makeMap(str){
433
428
}
434
429
435
430
436
-
437
- /**
438
- * HTML class which is the only class which can be used in ngBind to inline HTML for security
439
- * reasons.
440
- *
441
- * @constructor
442
- * @param html raw (unsafe) html
443
- * @param {string= } option If set to 'usafe', get method will return raw (unsafe/unsanitized) html
444
- */
445
- function HTML ( html , option ) {
446
- this . html = html ;
447
- this . get = lowercase ( option ) == 'unsafe'
448
- ? valueFn ( html )
449
- : function htmlSanitize ( ) {
450
- var buf = [ ] ;
451
- htmlParser ( html , htmlSanitizeWriter ( buf ) ) ;
452
- return buf . join ( '' ) ;
453
- } ;
454
- }
455
-
456
431
if ( msie < 9 ) {
457
432
nodeName_ = function ( element ) {
458
433
element = element . nodeName ? element : element [ 0 ] ;
@@ -465,12 +440,6 @@ if (msie < 9) {
465
440
} ;
466
441
}
467
442
468
- function isVisible ( element ) {
469
- var rect = element [ 0 ] . getBoundingClientRect ( ) ,
470
- width = ( rect . width || ( rect . right || 0 - rect . left || 0 ) ) ,
471
- height = ( rect . height || ( rect . bottom || 0 - rect . top || 0 ) ) ;
472
- return width > 0 && height > 0 ;
473
- }
474
443
475
444
function map ( obj , iterator , context ) {
476
445
var results = [ ] ;
@@ -671,17 +640,6 @@ function equals(o1, o2) {
671
640
return false ;
672
641
}
673
642
674
- function setHtml ( node , html ) {
675
- if ( isLeafNode ( node ) ) {
676
- if ( msie ) {
677
- node . innerText = html ;
678
- } else {
679
- node . textContent = html ;
680
- }
681
- } else {
682
- node . innerHTML = html ;
683
- }
684
- }
685
643
686
644
function concat ( array1 , array2 , index ) {
687
645
return array1 . concat ( slice . call ( array2 , index ) ) ;
@@ -742,7 +700,7 @@ function toJsonReplacer(key, value) {
742
700
}
743
701
744
702
return val ;
745
- } ;
703
+ }
746
704
747
705
748
706
/**
@@ -799,7 +757,7 @@ function startingTag(element) {
799
757
// turns out IE does not let you set .html() on elements which
800
758
// are not allowed to have children. So we just ignore it.
801
759
element . html ( '' ) ;
802
- } catch ( e ) { } ;
760
+ } catch ( e ) { }
803
761
return jqLite ( '<div>' ) . append ( element ) . html ( ) . match ( / ^ ( < [ ^ > ] + > ) / ) [ 1 ] ;
804
762
}
805
763
@@ -918,7 +876,7 @@ function angularInit(element, bootstrap) {
918
876
forEach ( element . querySelectorAll ( '.' + name ) , append ) ;
919
877
forEach ( element . querySelectorAll ( '.' + name + '\\:' ) , append ) ;
920
878
forEach ( element . querySelectorAll ( '[' + name + ']' ) , append ) ;
921
- } ;
879
+ }
922
880
} ) ;
923
881
924
882
forEach ( elements , function ( element ) {
@@ -1005,9 +963,7 @@ function bindJQuery() {
1005
963
*/
1006
964
function assertArg ( arg , name , reason ) {
1007
965
if ( ! arg ) {
1008
- var error = new Error ( "Argument '" + ( name || '?' ) + "' is " +
1009
- ( reason || "required" ) ) ;
1010
- throw error ;
966
+ throw new Error ( "Argument '" + ( name || '?' ) + "' is " + ( reason || "required" ) ) ;
1011
967
}
1012
968
return arg ;
1013
969
}
0 commit comments