Details
-
Bug
-
Resolution: Done
-
P2: Important
-
5.12.0 Beta 2, 5.12.4, 5.13.0
-
-
f3d40896c1d8601703fcbf30214e22f50eb72727 (qt/qtdeclarative/5.12)
Description
Returning a Promise inside a then callback does not resolve that promise. It just passes that promise to the next then callback.
Code:
new Promise((res) => { res(1) }) .then((data) => { console.log(data) return new Promise((res) => {res(2)}); }) .then((data) => { console.log(data) return new Promise((res) => {res(3)}); }) .then((data) => { console.log(data) });
Expected output:
qml: 1 qml: 2 qml: 3
Actual output:
qml: 1 qml: [object Promise] qml: [object Promise]
Attachments
For Gerrit Dashboard: QTBUG-71329 | ||||||
---|---|---|---|---|---|---|
# | Subject | Branch | Project | Status | CR | V |
267534,12 | Fix promise chaining | 5.12 | qt/qtdeclarative | Status: MERGED | +2 | 0 |