Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
[mm] Extend once-detection logic
  • Loading branch information
sorear committed Sep 18, 2010
1 parent dc6824e commit 2bc3b94
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/Metamodel.pm
Expand Up @@ -210,7 +210,7 @@ our $mainline;
sub Unit::begin {
my $self = shift;

$mainline = $self->mainline->begin;
$mainline = $self->mainline->begin(once => 1);
}

sub Body::begin {
Expand All @@ -225,7 +225,7 @@ sub Body::begin {
name => $self->name,
returnable => $self->returnable,
class => $self->class,
run_once => !defined($top));
run_once => $args{once} && (!defined($top) || $top->run_once));

$self->do->begin;

Expand Down Expand Up @@ -270,7 +270,7 @@ sub Op::PackageDef::begin {
if (!$self->stub) {
my $obj = $pclass->new(name => $self->name);
$ns->obj($obj);
my $body = $self->body->begin(body_of => $ns);
my $body = $self->body->begin(body_of => $ns, once => 1);
$opensubs[-1]->add_my_sub($self->bodyvar, $body);
}
}
Expand Down

0 comments on commit 2bc3b94

Please sign in to comment.