Skip to content

Commit

Permalink
Some extra tweaks to fix BUILDPLAN handling regressions.
Browse files Browse the repository at this point in the history
  • Loading branch information
jnthn committed Sep 1, 2012
1 parent 54f813b commit cfae063
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 17 deletions.
18 changes: 3 additions & 15 deletions src/Perl6/Metamodel/BUILDPLAN.pm
Expand Up @@ -19,11 +19,7 @@ role Perl6::Metamodel::BUILDPLAN {
my $build := $obj.HOW.find_method($obj, 'BUILD', :no_fallback(1));
if !nqp::isnull($build) && $build {
# We'll call the custom one.
my $entry := [0, $build];
@all_plan[+@all_plan] := $entry;
if $i == 0 {
@plan[+@plan] := $entry;
}
@plan[+@plan] := [0, $build];
}
else {
# No custom BUILD. Rather than having an actual BUILD
Expand All @@ -33,11 +29,7 @@ role Perl6::Metamodel::BUILDPLAN {
if $_.has_accessor {
my $attr_name := $_.name;
my $name := nqp::substr($attr_name, 2);
my $entry := [1, $obj, $name, $attr_name];
@all_plan[+@all_plan] := $entry;
if $i == 0 {
@plan[+@plan] := $entry;
}
@plan[+@plan] := [1, $obj, $name, $attr_name];
}
}
}
Expand All @@ -47,11 +39,7 @@ role Perl6::Metamodel::BUILDPLAN {
if nqp::can($_, 'build') {
my $default := $_.build;
if !nqp::isnull($default) && $default {
my $entry := [2, $obj, $_.name, $default];
@all_plan[+@all_plan] := $entry;
if $i == 0 {
@plan[+@plan] := $entry;
}
@plan[+@plan] := [4, $obj, $_.name, $default];
}
}
}
Expand Down
4 changes: 2 additions & 2 deletions src/core/Mu.pm
Expand Up @@ -92,7 +92,7 @@ my class Mu {
nqp::atpos($task, 3)) = pir::nqp_decontainerize__PP(%attrinit{$key_name});
}
}
elsif nqp::iseq_i(nqp::atpos_i($task, 0), 2) {
elsif nqp::iseq_i(nqp::atpos_i($task, 0), 4) {
unless nqp::attrinited(self, nqp::atpos($task, 1), nqp::atpos_s($task, 2)) {
my $attr := nqp::getattr(self, nqp::atpos($task, 1), nqp::atpos_s($task, 2));
$attr = nqp::atpos($task, 3)(self, $attr);
Expand Down Expand Up @@ -126,7 +126,7 @@ my class Mu {
nqp::atpos_s($task, 3)) = pir::nqp_decontainerize__PP(%attrinit{$key_name});
}
}
elsif nqp::iseq_i(nqp::atpos_i($task, 0), 2) {
elsif nqp::iseq_i(nqp::atpos_i($task, 0), 4) {
unless nqp::attrinited(self, nqp::atpos($task, 1), nqp::atpos_s($task, 2)) {
my $attr := nqp::getattr(self, nqp::atpos($task, 1), nqp::atpos_s($task, 2));
$attr = nqp::atpos($task, 3)(self, $attr);
Expand Down

0 comments on commit cfae063

Please sign in to comment.