gulpjs / gulp

A toolkit to automate & enhance your workflow
https://gulpjs.com
MIT License
33.01k stars 4.23k forks source link

Returning some fully compliant Promises/A+ promises from a task fail... #406

Closed sterpe closed 10 years ago

sterpe commented 10 years ago

Hey all,

I will file this issue with orchestrator as well. It seems like gulp/via orchestrator uses the existence of a 'done' method on a return object to evaluate whether the task returns a promise -- however the Promises/A+ spec does not have any normative or prescriptive interoperable specification that a promise implementation provide "promise.done()".

orchestrator/lib/runTask.js lines 36 - 40

    if (r && typeof r.done === 'function') {                                   
        // wait for promise to resolve                                         
        // FRAGILE: ASSUME: Promises/A+, see http://promises-aplus.github.io/promises-spec/
        r.done(function () {                                                   
            finish(null, 'promise');                                           
        }, function(err) {                                                     
            finish(err, 'promise');                                            
        });                        

Instead it specifies that all A+ promises must define only* an interoperable "promise.then()" method.

*edit: need only define, rather. lol.

sterpe commented 10 years ago

Filed with orchestrator as: https://github.com/orchestrator/orchestrator/issues/41

phated commented 10 years ago

Answered on orchestrator, so closing here.