Skip to content

Conversation

@akeit0
Copy link
Collaborator

@akeit0 akeit0 commented Dec 13, 2025

No description provided.

@akeit0 akeit0 requested a review from Copilot December 13, 2025 08:20
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR fixes the pairs and ipairs functions to properly support metamethods (__pairs and __ipairs) for non-table types. Previously, these functions only checked for metamethods on LuaTable objects, which prevented non-table types with custom metatables from implementing custom iteration behavior.

Key changes:

  • Modified argument retrieval to accept any LuaValue type instead of requiring LuaTable
  • Updated metamethod lookup to use GlobalState.TryGetMetatable which works with any value type
  • Added type validation that throws an error if the value is not a table and no metamethod is found

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

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.

2 participants