After the fix for issue #9 a side effect happened, sometimes the anonymous functions are getting the root m instead of the context of the parent object. Below a code to reproduce the issue:
sub main()
m.name = "root"
level1 = {name: "level1", param: "test result was: "}
level1.run = sub()
print m.name
print createLevel2().testResult(m.param)
end sub
level1.run()
end sub
function createLevel2()
instance = __level2_builder()
instance.new()
return instance
end function
function __level2_builder()
print m.name
instance = {name: "level2"}
instance.new = sub()
print m.name
m.name = "newName"
end sub
instance.testResult = function(param) as string
if m.name = "newName"
result = "success"
else
result = "fail"
end if
return param + result
end function
return instance
end function
This code must print test result was: success but in the current version 0.45.3 it shows test result was: fail
After the fix for issue #9 a side effect happened, sometimes the anonymous functions are getting the root
m
instead of the context of the parent object. Below a code to reproduce the issue:This code must print
test result was: success
but in the current version 0.45.3 it showstest result was: fail