New issue
Advanced search Search tips

Issue 849085 link

Starred by 1 user

Issue metadata

Status: WontFix
Owner: ----
Closed: Nov 29
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: Windows
Pri: 2
Type: Bug



Sign in to add a comment

Resolving a Promise with a pseudo promise gets stuck in pending

Reported by rycoche...@gmail.com, Jun 3 2018

Issue description

UserAgent: 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.
 
Labels: Needs-Triage-M66

Comment 2 by tkent@chromium.org, Jun 4 2018

Components: -Blink Blink>JavaScript
Cc: phanindra.mandapaka@chromium.org
Labels: Triaged-ET Needs-Feedback
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.
Status: WontFix (was: Unconfirmed)
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...

The test case code is literally in the report itself - but whatever...

Sign in to add a comment