Each frame may contain sub-frames. If child N is a sub-frame, then the items queued within it are given priority over child N+1.
cancelRemainingTasks(reason)code »
Marks all of the tasks that are descendants of this frame in the execution tree as cancelled. This is necessary for callbacks scheduled asynchronous. For example:
var someResult;
promise.createFlow(function(flow) {
someResult = flow.execute(function() {});
throw Error();
}).thenCatch(function(err) {
console.log('flow failed: ' + err);
someResult.then(function() {
console.log('task succeeded!');
}, function(err) {
console.log('task failed! ' + err);
});
});
// flow failed: Error: boom
// task failed! CancelledTaskError: Task discarded due to a previous
// task failure: Error: boom