Skip to content

Commit

Permalink
[js] Make nqp::getattr in void use autovivify the attribute
Browse files Browse the repository at this point in the history
  • Loading branch information
pmurias committed Apr 4, 2018
1 parent 0edf50d commit 44d03f8
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/vm/js/Operations.nqp
Expand Up @@ -343,7 +343,7 @@ class QAST::OperationsJS {
my $obj := $comp.as_js(:want($T_OBJ), $node[0]);
if static_hint($node) -> $hint {
if $type == $T_OBJ {
Chunk.new($T_OBJ, "{$obj.expr}\.\$\$getattr\${$hint}()", $obj);
$comp.stored_result(Chunk.new($T_OBJ, "{$obj.expr}\.\$\$getattr\${$hint}()", $obj), :$want);
}
else {
Chunk.new($type, "{$obj.expr}\.attr\${$hint}", $obj);
Expand All @@ -353,8 +353,8 @@ class QAST::OperationsJS {
my $classHandle := $comp.as_js(:want($T_OBJ), $node[1]);
my $attrName := $comp.as_js(:want($T_STR), $node[2]);

Chunk.new($type, "{$obj.expr}\.\$\$getattr{$suffix}({$classHandle.expr}, {$attrName.expr})",
[$obj, $classHandle, $attrName]);
$comp.stored_result(Chunk.new($type, "{$obj.expr}\.\$\$getattr{$suffix}({$classHandle.expr}, {$attrName.expr})",
[$obj, $classHandle, $attrName]), :$want);
}
});
}
Expand Down

0 comments on commit 44d03f8

Please sign in to comment.