Skip to content

Promise doesn't handle then-able result #260

@RuralHunter

Description

@RuralHunter

In real browser(Chrome), if the resolve function returns a then-able object(having then function), Promise.then handles it. But htmlunit fails to do so. Test case:

           var thenable={
                then: function(onFulfill, onReject) { onFulfill('fulfilled!'); },
                value: 'aaa'
            };
            var p = Promise.resolve(1);
            var p1=p.then(function(value) {
                //console.log(value);
                return thenable;
            });
            p1.then(function(value) {
                console.log(value);
            });

chrome outputs 'fulfilled!' but htmlunit outputs the thenable object.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions