mirror of
https://github.com/mruby/mruby
synced 2026-06-08 16:11:16 +00:00
Merge pull request #579 from skandhas/pr-remove-incorrect-pop-in-codegen
remove incorrect pop() call in codegen
This commit is contained in:
@@ -1412,7 +1412,6 @@ codegen(codegen_scope *s, node *tree, int val)
|
||||
codegen(s, tree->cdr->cdr->car, VAL);
|
||||
pop();
|
||||
gen_assignment(s, tree->car, cursp(), val);
|
||||
if (val) pop();
|
||||
dispatch(s, pos);
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -58,3 +58,14 @@ assert('Nested const reference') do
|
||||
Syntax4Const::CONST1 == "hello world" and
|
||||
Syntax4Const::Const2.new.const1 == "hello world"
|
||||
end
|
||||
|
||||
assert('Abbreviated variable assignment as returns') do
|
||||
module Syntax4AbbrVarAsgnAsReturns
|
||||
class A
|
||||
def b
|
||||
@c ||= 1
|
||||
end
|
||||
end
|
||||
end
|
||||
Syntax4AbbrVarAsgnAsReturns::A.new.b == 1
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user