Skip to content

Could __iter be removed from quaternion and uuid now that __call doesn't iter? #80

@Suzanna-Linn

Description

@Suzanna-Linn

slua/VM/src/llsl.cpp

Lines 1665 to 1672 in f629edc

// We need to override __iter so generalized iteration doesn't try to use __call.
lua_rawgetfield(L, LUA_BASEGLOBALSINDEX, "pairs");
// This is confusing at first, but we want a unique function identity
// when this shows up anywhere other than globals, otherwise we can
// muck up Ares serialization.
luau_dupcclosure(L, -1, "__iter");
lua_replace(L, -2);
lua_rawsetfield(L, -2, "__iter");

slua/VM/src/llsl.cpp

Lines 1709 to 1716 in f629edc

// We need to override __iter so generalized iteration doesn't try to use __call.
lua_rawgetfield(L, LUA_BASEGLOBALSINDEX, "pairs");
// This is confusing at first, but we want a unique function identity
// when this shows up anywhere other than globals, otherwise we can
// muck up Ares serialization.
luau_dupcclosure(L, -1, "__iter");
lua_replace(L, -2);
lua_rawsetfield(L, -2, "__iter");

Metadata

Metadata

Assignees

Labels

enhancementNew feature or request

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions