@@ -74,7 +74,7 @@ public class Task<Progress, Value, Error>: Printable
74
74
75
75
public var state : TaskState { return self . _machine. state }
76
76
77
- /// progress value
77
+ /// progress value (NOTE: always nil when `weakified = true`)
78
78
public var progress : Progress ? { return self . _machine. progress }
79
79
80
80
/// fulfilled value
@@ -118,7 +118,7 @@ public class Task<Progress, Value, Error>: Printable
118
118
{
119
119
self . _weakified = weakified
120
120
self . _paused = paused
121
- self . _machine = _Machine ( paused: paused)
121
+ self . _machine = _Machine ( weakified : weakified , paused: paused)
122
122
123
123
let _initClosure : _InitClosure = { _, progress, fulfill, _reject, configure in
124
124
// NOTE: don't expose rejectHandler with ErrorInfo (isCancelled) for public init
@@ -192,7 +192,7 @@ public class Task<Progress, Value, Error>: Printable
192
192
{
193
193
self . _weakified = weakified
194
194
self . _paused = paused
195
- self . _machine = _Machine ( paused: paused)
195
+ self . _machine = _Machine ( weakified : weakified , paused: paused)
196
196
197
197
self . setup ( weakified, paused: paused, _initClosure)
198
198
}
@@ -325,6 +325,8 @@ public class Task<Progress, Value, Error>: Printable
325
325
///
326
326
/// - e.g. task.progress { oldProgress, newProgress in ... }
327
327
///
328
+ /// NOTE: `oldProgress` is always nil when `weakified = true`
329
+ ///
328
330
public func progress( progressClosure: ProgressTuple -> Void ) -> Task
329
331
{
330
332
self . _machine. progressTupleHandlers. append ( progressClosure)
0 commit comments