@@ -172,16 +172,16 @@ $traceurRuntime.defaultSuperCall = defaultSuperCall;
172
172
} ;
173
173
}
174
174
function hasIterator ( maybeIterable ) {
175
- return ! ! _iteratorFn ( maybeIterable ) ;
175
+ return ! ! getIteratorFn ( maybeIterable ) ;
176
176
}
177
177
function isIterator ( maybeIterator ) {
178
178
return maybeIterator && typeof maybeIterator . next === 'function' ;
179
179
}
180
180
function getIterator ( iterable ) {
181
- var iteratorFn = _iteratorFn ( iterable ) ;
181
+ var iteratorFn = getIteratorFn ( iterable ) ;
182
182
return iteratorFn && iteratorFn . call ( iterable ) ;
183
183
}
184
- function _iteratorFn ( iterable ) {
184
+ function getIteratorFn ( iterable ) {
185
185
var iteratorFn = iterable && ( ( REAL_ITERATOR_SYMBOL && iterable [ REAL_ITERATOR_SYMBOL ] ) || iterable [ FAUX_ITERATOR_SYMBOL ] ) ;
186
186
if ( typeof iteratorFn === 'function' ) {
187
187
return iteratorFn ;
@@ -510,37 +510,33 @@ $traceurRuntime.defaultSuperCall = defaultSuperCall;
510
510
return typeof valueA . equals === 'function' && typeof valueB . equals === 'function' ? valueA . equals ( valueB ) : valueA === valueB || ( valueA !== valueA && valueB !== valueB ) ;
511
511
}
512
512
function fromJS ( json , converter ) {
513
- return converter ? _fromJSWith ( converter , json , '' , { '' : json } ) : _fromJSDefault ( json ) ;
513
+ return converter ? fromJSWith ( converter , json , '' , { '' : json } ) : fromJSDefault ( json ) ;
514
514
}
515
- function _fromJSWith ( converter , json , key , parentJSON ) {
515
+ function fromJSWith ( converter , json , key , parentJSON ) {
516
516
if ( Array . isArray ( json ) ) {
517
517
return converter . call ( parentJSON , key , IndexedSeq ( json ) . map ( ( function ( v , k ) {
518
- return _fromJSWith ( converter , v , k , json ) ;
518
+ return fromJSWith ( converter , v , k , json ) ;
519
519
} ) ) ) ;
520
520
}
521
521
if ( isPlainObj ( json ) ) {
522
522
return converter . call ( parentJSON , key , KeyedSeq ( json ) . map ( ( function ( v , k ) {
523
- return _fromJSWith ( converter , v , k , json ) ;
523
+ return fromJSWith ( converter , v , k , json ) ;
524
524
} ) ) ) ;
525
525
}
526
526
return json ;
527
527
}
528
- function _fromJSDefault ( json ) {
528
+ function fromJSDefault ( json ) {
529
529
if ( Array . isArray ( json ) ) {
530
- return IndexedSeq ( json ) . map ( _fromJSDefault ) . toList ( ) ;
530
+ return IndexedSeq ( json ) . map ( fromJSDefault ) . toList ( ) ;
531
531
}
532
532
if ( isPlainObj ( json ) ) {
533
- return KeyedSeq ( json ) . map ( _fromJSDefault ) . toMap ( ) ;
533
+ return KeyedSeq ( json ) . map ( fromJSDefault ) . toMap ( ) ;
534
534
}
535
535
return json ;
536
536
}
537
537
function isPlainObj ( value ) {
538
538
return value && value . constructor === Object ;
539
539
}
540
- function invariant ( condition , error ) {
541
- if ( ! condition )
542
- throw new Error ( error ) ;
543
- }
544
540
var Math__imul = typeof Math . imul === 'function' && Math . imul ( 0xffffffff , 2 ) === - 2 ? Math . imul : function Math__imul ( a , b ) {
545
541
a = a | 0 ;
546
542
b = b | 0 ;
@@ -672,6 +668,10 @@ $traceurRuntime.defaultSuperCall = defaultSuperCall;
672
668
var STRING_HASH_CACHE_MAX_SIZE = 255 ;
673
669
var STRING_HASH_CACHE_SIZE = 0 ;
674
670
var stringHashCache = { } ;
671
+ function invariant ( condition , error ) {
672
+ if ( ! condition )
673
+ throw new Error ( error ) ;
674
+ }
675
675
function assertNotInfinite ( size ) {
676
676
invariant ( size !== Infinity , 'Cannot perform this action with an infinite size.' ) ;
677
677
}
@@ -1289,16 +1289,16 @@ $traceurRuntime.defaultSuperCall = defaultSuperCall;
1289
1289
var entry = iterable . toSeq ( ) . map ( ( function ( v , k ) {
1290
1290
return [ v , mapper ( v , k , iterable ) ] ;
1291
1291
} ) ) . reduce ( ( function ( a , b ) {
1292
- return _maxCompare ( comparator , a [ 1 ] , b [ 1 ] ) ? b : a ;
1292
+ return maxCompare ( comparator , a [ 1 ] , b [ 1 ] ) ? b : a ;
1293
1293
} ) ) ;
1294
1294
return entry && entry [ 0 ] ;
1295
1295
} else {
1296
1296
return iterable . reduce ( ( function ( a , b ) {
1297
- return _maxCompare ( comparator , a , b ) ? b : a ;
1297
+ return maxCompare ( comparator , a , b ) ? b : a ;
1298
1298
} ) ) ;
1299
1299
}
1300
1300
}
1301
- function _maxCompare ( comparator , a , b ) {
1301
+ function maxCompare ( comparator , a , b ) {
1302
1302
var comp = comparator ( b , a ) ;
1303
1303
return ( comp === 0 && b !== a && ( b === undefined || b === null || b !== b ) ) || comp > 0 ;
1304
1304
}
@@ -3184,9 +3184,6 @@ $traceurRuntime.defaultSuperCall = defaultSuperCall;
3184
3184
if ( end === undefined ) {
3185
3185
end = Infinity ;
3186
3186
}
3187
- if ( start === end && __EMPTY_RANGE ) {
3188
- return __EMPTY_RANGE ;
3189
- }
3190
3187
step = step === undefined ? 1 : Math . abs ( step ) ;
3191
3188
if ( end < start ) {
3192
3189
step = - step ;
@@ -3195,6 +3192,12 @@ $traceurRuntime.defaultSuperCall = defaultSuperCall;
3195
3192
this . _end = end ;
3196
3193
this . _step = step ;
3197
3194
this . size = Math . max ( 0 , Math . ceil ( ( end - start ) / step - 1 ) + 1 ) ;
3195
+ if ( this . size === 0 ) {
3196
+ if ( EMPTY_RANGE ) {
3197
+ return EMPTY_RANGE ;
3198
+ }
3199
+ EMPTY_RANGE = this ;
3200
+ }
3198
3201
} ;
3199
3202
var $Range = Range ;
3200
3203
( $traceurRuntime . createClass ) ( Range , {
@@ -3218,7 +3221,7 @@ $traceurRuntime.defaultSuperCall = defaultSuperCall;
3218
3221
begin = resolveBegin ( begin , this . size ) ;
3219
3222
end = resolveEnd ( end , this . size ) ;
3220
3223
if ( end <= begin ) {
3221
- return __EMPTY_RANGE ;
3224
+ return new $Range ( 0 , 0 ) ;
3222
3225
}
3223
3226
return new $Range ( this . get ( begin , this . _end ) , this . get ( end , this . _end ) , this . _step ) ;
3224
3227
} ,
@@ -3262,17 +3265,17 @@ $traceurRuntime.defaultSuperCall = defaultSuperCall;
3262
3265
return other instanceof $Range ? this . _start === other . _start && this . _end === other . _end && this . _step === other . _step : deepEqual ( this , other ) ;
3263
3266
}
3264
3267
} , { } , IndexedSeq ) ;
3265
- var __EMPTY_RANGE = Range ( 0 , 0 ) ;
3268
+ var EMPTY_RANGE ;
3266
3269
var Repeat = function Repeat ( value , times ) {
3267
- if ( times <= 0 && EMPTY_REPEAT ) {
3268
- return EMPTY_REPEAT ;
3269
- }
3270
3270
if ( ! ( this instanceof $Repeat ) ) {
3271
3271
return new $Repeat ( value , times ) ;
3272
3272
}
3273
3273
this . _value = value ;
3274
3274
this . size = times === undefined ? Infinity : Math . max ( 0 , times ) ;
3275
3275
if ( this . size === 0 ) {
3276
+ if ( EMPTY_REPEAT ) {
3277
+ return EMPTY_REPEAT ;
3278
+ }
3276
3279
EMPTY_REPEAT = this ;
3277
3280
}
3278
3281
} ;
@@ -3330,9 +3333,8 @@ $traceurRuntime.defaultSuperCall = defaultSuperCall;
3330
3333
} , { } , IndexedSeq ) ;
3331
3334
var EMPTY_REPEAT ;
3332
3335
function mixin ( ctor , methods ) {
3333
- var proto = ctor . prototype ;
3334
3336
var keyCopier = ( function ( key ) {
3335
- proto [ key ] = methods [ key ] ;
3337
+ ctor . prototype [ key ] = methods [ key ] ;
3336
3338
} ) ;
3337
3339
Object . keys ( methods ) . forEach ( keyCopier ) ;
3338
3340
Object . getOwnPropertySymbols && Object . getOwnPropertySymbols ( methods ) . forEach ( keyCopier ) ;
0 commit comments