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])
|
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
|
||||||
|
@ -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
|
||||||
|
Loading…
Reference in New Issue
Block a user