Fix infinite loop with promise#9306
Conversation
kripken
left a comment
There was a problem hiding this comment.
Thanks @xcodebuild!
Looks good to me. Please just add a test. It can be in tests/test_other.py, and I'm not sure if there's a natural test to add this to, so perhaps just a new test at the end? Let me know if you need help with the python setup.
There was a problem hiding this comment.
Sorry, but this is a bad solution. You should be able to call .then() multiple times, including after the promise has been resolved.
The collective wisdom of #5820 was to export a .ready promise, while deprecating .then() (but only removing it later).
|
Thanks @curiousdannii, I forgot those details, sorry... Perhaps we should at this point remove cc @kainino0x who had another idea here. I think a breaking change here is fine, as long as we have good error messages for people to find what to do to fix things. |
|
I'll try to open a PR very soon with an alternative. Removing .then seems A-OK to me - code which uses it would be very minimally broken. |
|
Well, why not simply let the output of MODULARIZE return a real Promise directly ? That would solve such issues (which I discovered recently too), as well as adding convenient features such as ability to .catch((error)) or await. eg: |
|
@gabrielcuvillier Take a look at #9325 |
|
The deletion of the Re-opening and re-targeting to master. |
|
This issue has been automatically marked as stale because there has been no activity in the past year. It will be closed automatically if no further activity occurs in the next 30 days. Feel free to re-open at any time if this issue is still relevant. |
|
This issue has been automatically marked as stale because there has been no activity in the past year. It will be closed automatically if no further activity occurs in the next 30 days. Feel free to re-open at any time if this issue is still relevant. |
.theninModulelike Promise would cause infinite loop when user use it as a real Promise likeSimplified code