Skip to content

fix(promise): Check for a promise without indexing the value - #846

Open
oiisin wants to merge 1 commit into
Quenty:mainfrom
oiisin:users/oiisin/promise-ispromise-safe
Open

oiisin wants to merge 1 commit into
Quenty:mainfrom
oiisin:users/oiisin/promise-ispromise-safe

Conversation

@oiisin

@oiisin oiisin commented Oct 24, 2026

Copy link
Copy Markdown
Contributor

Promise.isPromise read value.ClassName, which runs the value's __index, so returning or resolving any table that errors on unknown keys (Cmdr's Registry and Dispatcher do, for example) threw "ClassName is not a valid member" from inside Promise code. It now reads ClassName off the metatable with rawget, which still matches promises from another copy of the package; the one behaviour change is that a bare { ClassName = "Promise" } table no longer counts, and nothing in the repo relies on that. The spec covers both cases, and all 129 promise specs pass in Studio.

Promise.isPromise read value.ClassName, which runs the value's __index, so anything handed to
Promise code that errors on unknown keys (Cmdr's Registry and Dispatcher, for example) threw
instead of being treated as a plain value. It now reads ClassName from the metatable with rawget,
which still matches promises from another copy of the package.

This branch had an error being deployed

1 failed deployment
integration — 8e1faf83 Deployed Oct 24, 2026 by oiisin via integration #690
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant