Skip to content

Add EMPTY type to PromiseResult#305

Merged
jhnaldo merged 1 commit intodevfrom
update-promise-result-type
Jul 31, 2025
Merged

Add EMPTY type to PromiseResult#305
jhnaldo merged 1 commit intodevfrom
update-promise-result-type

Conversation

@mobius29
Copy link
Copy Markdown
Contributor

The PromisResult Type was updated in tc39/ecma262#3491, but this change has not yet been incorporated into esmeta.

As a result, the following type mismatch occurs, even though the Object structurally satisfies the Promise type

[ParamTypeMismatch] Call[35542] argument assignment to first parameter _promise_ when Call[35542] function call from INTRINSICS.yet:PromiseRejectFunction (step 7, 8:24(412)-8:58(446)) to RejectPromise
- expected: Record[Promise]
- actual  : Record[Object { DefineOwnProperty: Clo["Record[OrdinaryObject].DefineOwnProperty"], Delete: Clo["Record[OrdinaryObject].Delete"], Extensible: Boolean, Get: Clo["Record[OrdinaryObject].Get"], GetOwnProperty: Clo["Record[OrdinaryObject].GetOwnProperty"], GetPrototypeOf: Clo["Record[OrdinaryObject].GetPrototypeOf"], HasProperty: Clo["Record[OrdinaryObject].HasProperty"], IsExtensible: Clo["Record[OrdinaryObject].IsExtensible"], OwnPropertyKeys: Clo["Record[OrdinaryObject].OwnPropertyKeys"], PreventExtensions: Clo["Record[OrdinaryObject].PreventExtensions"], PrivateElements: Nil, PromiseFulfillReactions: List[Record[PromiseReactionRecord { Capability: Record[PromiseCapabilityRecord], Handler: Enum[~empty~], Type: Enum[~fulfill~] }]], PromiseIsHandled: Boolean, PromiseRejectReactions: List[Record[PromiseReactionRecord { Capability: Record[PromiseCapabilityRecord], Handler: Record[JobCallbackRecord], Type: Enum[~reject~] }]], PromiseResult: Enum[~empty~], PromiseState: Enum[~pending~], Prototype: Record[OrdinaryObject], Set: Clo["Record[OrdinaryObject].Set"], SetPrototypeOf: Clo["Record[OrdinaryObject].SetPrototypeOf"], __MAP__: Map }]

This PR updates esmeta to incorporate and reflect that change.

Refine Promise into PendingPromise and SettledPromise based on Promise
State

Change the number of type model
@mobius29 mobius29 force-pushed the update-promise-result-type branch from cc8a892 to 4839f0a Compare July 31, 2025 02:09
@jhnaldo jhnaldo merged commit e528c23 into dev Jul 31, 2025
6 checks passed
@jhnaldo jhnaldo deleted the update-promise-result-type branch July 31, 2025 04:03
@jhnaldo jhnaldo added enhancement Enhance the quality of a feature area:type Related to types labels Jan 2, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area:type Related to types enhancement Enhance the quality of a feature

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants