mirror of
https://github.com/leafo/moonscript.git
synced 2025-01-09 00:04:22 +00:00
super works inside class methods
This commit is contained in:
parent
3be7be0166
commit
a9bb80159f
@ -118,7 +118,13 @@ return function(self, node, ret, parent_assign)
|
|||||||
for _index_1 = 2, #item do
|
for _index_1 = 2, #item do
|
||||||
local tuple = item[_index_1]
|
local tuple = item[_index_1]
|
||||||
if ntype(tuple[1]) == "self" then
|
if ntype(tuple[1]) == "self" then
|
||||||
insert(statements, build.assign_one(unpack(tuple)))
|
local k, v
|
||||||
|
k, v = tuple[1], tuple[2]
|
||||||
|
v = super_scope(v, cls_super, {
|
||||||
|
"key_literal",
|
||||||
|
k[2]
|
||||||
|
})
|
||||||
|
insert(statements, build.assign_one(k, v))
|
||||||
else
|
else
|
||||||
insert(properties, tuple)
|
insert(properties, tuple)
|
||||||
end
|
end
|
||||||
|
@ -92,7 +92,9 @@ super_scope = (value, t, key) ->
|
|||||||
when "props"
|
when "props"
|
||||||
for tuple in *item[2,]
|
for tuple in *item[2,]
|
||||||
if ntype(tuple[1]) == "self"
|
if ntype(tuple[1]) == "self"
|
||||||
insert statements, build.assign_one unpack tuple
|
{k,v} = tuple
|
||||||
|
v = super_scope v, cls_super, {"key_literal", k[2]}
|
||||||
|
insert statements, build.assign_one k, v
|
||||||
else
|
else
|
||||||
insert properties, tuple
|
insert properties, tuple
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user