Module:FunList/Sandbox: Difference between revisions

Update ipairs/pairs override
(Add ipairs override)
(Update ipairs/pairs override)
Line 124: Line 124:
     end;
     end;
     __ipairs = function(self)
     __ipairs = function(self)
         return self.nextFunc, self.contextFactory(), 0
         return self.nextFunc, self.contextFactory(), self.index
     end;
     end;
}
}
Line 148: Line 148:
end
end


function Enumerator3.ipairs(self)
    return self.nextFunc, self.contextFactory(), 0
end
--------------------------------------------------------------------------------
--------------------------------------------------------------------------------
-- Helper function for setting up iterator.
-- Helper function for setting up iterator.
Line 1,148: Line 1,145:
     end
     end
     return nil
     return nil
end
function Enumerator3.ipairs(self)
    return getIterator(self)
end
function Enumerator3.pairs(self)
    return getIterator(self)
end
end


2,875

edits