mirror of
https://github.com/leafo/moonscript.git
synced 2024-11-22 02:44:23 +00:00
don't error on value named super outside class
This commit is contained in:
parent
fc72baf423
commit
cd5087b08b
@ -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
|
||||
|
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user