moonsharp-devs / moonsharp

An interpreter for the Lua language, written entirely in C# for the .NET, Mono, Xamarin and Unity3D platforms, including handy remote debugger facilities.
http://www.moonsharp.org
Other
1.42k stars 214 forks source link

__newindex not supported? #133

Closed pkuvegeta closed 8 years ago

pkuvegeta commented 8 years ago

local aClass = {} setmetatable(aClass, {newindex = function() end, index = function() end })

local p = {a = 1, b = 2} for , v in pairs(p) do aClass[] = v end

This program break in Moonsharp It throws exception for attempting to call Tuple (next, table, "a") at the for loop line in the second iteration.

xanathar commented 8 years ago

Bad bug. Checking into it. It's not that __newindex is unsupported or anything.. for some reasons the internal stack gets trashed.

xanathar commented 8 years ago

Fixed on develop branch.