onTime {
our $pos : Attr('position');
our $active;
if ($active) {
$pos->[0]++;
}
}
####
onTime {
our $x : Attr('something');
our @fixups;
foreach (@fixups) {
$x += $_;
}
@fixups = ();
}
##
##
onTime {
my $attr = $NODE->getAttr("something");
my $val = $attr->getValue();
foreach (@fixups) {
$val += $_;
}
@fixups = ();
$attr->setValue($val);
$attr->doCallbacks();
}
##
##
onTime {
my $attr = $NODE->getAttr("something");
my $val = $attr->getValue();
my $was_updated = 0;
foreach (@fixups) {
$val += $_;
$was_updated = 1;
}
@fixups = ();
if ($was_updated) {
$attr->setValue($val);
$attr->doCallbacks();
}
}