@@ -89,9 +89,13 @@ if (typeof process !== "undefined") {
89
89
} else {
90
90
( function ( ) {
91
91
// linked list of tasks (single, with head node)
92
- var head = { task : void 0 , next : null } , tail = head ,
93
- maxPendingTicks = 2 , pendingTicks = 0 , queuedTasks = 0 , usedTicks = 0 ,
94
- requestTick ;
92
+ var head = { task : void 0 , next : null } ;
93
+ var tail = head ;
94
+ var maxPendingTicks = 2 ;
95
+ var pendingTicks = 0 ;
96
+ var queuedTasks = 0 ;
97
+ var usedTicks = 0 ;
98
+ var requestTick = void 0 ;
95
99
96
100
function onTick ( ) {
97
101
// In case of multiple tasks ensure at least one subsequent tick
@@ -102,7 +106,10 @@ if (typeof process !== "undefined") {
102
106
// Amortize latency after thrown exceptions.
103
107
usedTicks = 0 ;
104
108
maxPendingTicks *= 4 ; // fast grow!
105
- var expectedTicks = queuedTasks && Math . min ( queuedTasks - 1 , maxPendingTicks ) ;
109
+ var expectedTicks = queuedTasks && Math . min (
110
+ queuedTasks - 1 ,
111
+ maxPendingTicks
112
+ ) ;
106
113
while ( pendingTicks < expectedTicks ) {
107
114
++ pendingTicks ;
108
115
requestTick ( ) ;
@@ -122,7 +129,10 @@ if (typeof process !== "undefined") {
122
129
123
130
nextTick = function ( task ) {
124
131
tail = tail . next = { task : task , next : null } ;
125
- if ( pendingTicks < ++ queuedTasks && pendingTicks < maxPendingTicks ) {
132
+ if (
133
+ pendingTicks < ++ queuedTasks &&
134
+ pendingTicks < maxPendingTicks
135
+ ) {
126
136
++ pendingTicks ;
127
137
requestTick ( ) ;
128
138
}
@@ -409,7 +419,9 @@ function defer() {
409
419
// Reify the stack into a string by using the accessor; this prevents
410
420
// memory leaks as per GH-111. At the same time, cut off the first line;
411
421
// it's always just "[object Promise]\n", as per the `toString`.
412
- promise . stack = promise . stack . substring ( promise . stack . indexOf ( "\n" ) + 1 ) ;
422
+ promise . stack = promise . stack . substring (
423
+ promise . stack . indexOf ( "\n" ) + 1
424
+ ) ;
413
425
}
414
426
415
427
function become ( resolvedValue ) {
@@ -436,11 +448,15 @@ function defer() {
436
448
} ;
437
449
deferred . notify = function ( progress ) {
438
450
if ( pending ) {
439
- array_reduce ( progressListeners , function ( undefined , progressListener ) {
440
- nextTick ( function ( ) {
441
- progressListener ( progress ) ;
442
- } ) ;
443
- } , void 0 ) ;
451
+ array_reduce (
452
+ progressListeners ,
453
+ function ( undefined , progressListener ) {
454
+ nextTick ( function ( ) {
455
+ progressListener ( progress ) ;
456
+ } ) ;
457
+ } ,
458
+ void 0
459
+ ) ;
444
460
}
445
461
} ;
446
462
@@ -498,7 +514,9 @@ Q.makePromise = makePromise;
498
514
function makePromise ( descriptor , fallback , valueOf , exception , isException ) {
499
515
if ( fallback === void 0 ) {
500
516
fallback = function ( op ) {
501
- return reject ( new Error ( "Promise does not support operation: " + op ) ) ;
517
+ return reject ( new Error (
518
+ "Promise does not support operation: " + op
519
+ ) ) ;
502
520
} ;
503
521
}
504
522
0 commit comments