don't error on value named super outside class

This commit is contained in:
leaf corcoran 2011-12-02 20:42:46 -08:00
parent fc72baf423
commit cd5087b08b
2 changed files with 6 additions and 4 deletions

View File

@ -309,8 +309,9 @@ value_compile = {
return "self:" .. self:value(node[2])
end,
raw_value = function(self, value)
if value == "super" then
return self:value(self:get("super")(self))
local sup = self:get("super")
if value == "super" and sup then
return self:value(sup(self))
end
if value == "..." then
self.has_varargs = true

View File

@ -181,8 +181,9 @@ value_compile =
-- catch all pure string values
raw_value: (value) =>
if value == "super"
return @value @get"super" self
sup = @get"super"
if value == "super" and sup
return @value sup self
if value == "..."
@has_varargs = true