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]) return "self:" .. self:value(node[2])
end, end,
raw_value = function(self, value) raw_value = function(self, value)
if value == "super" then local sup = self:get("super")
return self:value(self:get("super")(self)) if value == "super" and sup then
return self:value(sup(self))
end end
if value == "..." then if value == "..." then
self.has_varargs = true self.has_varargs = true

View File

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