[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: Common Lua (Logic/Style etc) Errors Detectable Through Static Analysis
- From: Jon Akhtar <akhtar@...>
- Date: Tue, 15 Feb 2011 09:59:59 -0500
> -- self explicitly included in parameter list: OK
> function object.goodmethod1(self) print(self) end
>
> -- self implicitly included in parameter list: OK
> function object:goodmethod2() print(self) end
>
> -- self refers to a global, probably not what was intended!
> function object.badmethod() print(self) end
Global self is already on my list of "inspections". It is an insidious error.