Resolving a Promise with a pseudo promise gets stuck in pending
Reported by
rycoche...@gmail.com,
Jun 3 2018
|
||||
Issue descriptionUserAgent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/66.0.3359.181 Safari/537.36 Steps to reproduce the problem: Minimal test case: var test = [1, 2, 3], resolver, promise = new Promise((resolve, reject) => resolver = resolve); test.then = promise.then.bind(promise); test.then((value) => console.log(value)) resolver(test); What is the expected behavior? As it's not a "real" promise with the system `[[PromiseStatus]]` or `[[PromiseValue]]` keys it shouldn't be treated like a Promise. When treated like a value the `.then()` should be called with `test` as the value, and it should simply log the test element to the console. What went wrong? If is seeing the `.then` member on the object and as per the spec is treating it like a Promise - however it doesn't know how to deal with this promise as there's no internal `[[PromiseStatus]]`, and it can never tell if it's resolved that way. In more complex situations it actually locks up the browser tab completely - this hasn't been so easy to write into a simple test case however. Did this work before? N/A Chrome version: 66.0.3359.181 Channel: stable OS Version: 10.0 Flash Version: Due to `[[PromiseStatus]]` and `[[PromiseValue]]` both being internal keys with no way to access from Javascript there's no way to bypass this. If you try to resolve a Promise with itself then it will throw an error, however this is specifically to allow adding Promise capabilities to an object that cannot otherwise be replaced with a Promise.
,
Jun 4 2018
,
Jun 4 2018
Thanks for filing the issue! @Reporter: Could you please share a sample test file/ or jsfiddle URL for ease of reproducing this issue and check whether this is regressio or not.
,
Nov 29
As there is no update from the reporter since a long time, marking this issue as WontFix. Please feel free to raise a new bug if any issues are observed on the latest Chrome builds. Thanks...
,
Nov 29
The test case code is literally in the report itself - but whatever... |
||||
►
Sign in to add a comment |
||||
Comment 1 by krajshree@chromium.org
, Jun 3 2018