递归承诺会发生内存泄漏吗?

does a recursive promise suffer memory leak?

考虑这个片段,其中函数 b 获得一个承诺并在它被解析时调用自身以获得另一个承诺:

var a = function () {
    var timeout = 1000;

    let time_promise = new Promise((resolve, reject) => {
        let success = false;

        setTimeout(()=> {
        document.getElementById('log').appendChild(document.createTextNode("Called   "));
            resolve();
        }, timeout);
        });

    return time_promise;

};

var b = function() {
    a().then(()=>{
        //is the first b() released after this call?
        b();
    });
};

b();

code on jsfiddle

我的问题是:对b的第一次调用是在调用自己之后释放的吗?请注意,对自身的调用是在必须调用 then 时调用的函数内部。

没有递归。 b 不调用自己。回调调用 b 并在 b 完成后调用回调。