Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Only throw when the value wasn't given
Previous, adding "is required" would always die.
  • Loading branch information
coke committed Jun 23, 2015
1 parent 1955a5a commit b484e3b
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src/core/Mu.pm
Expand Up @@ -181,9 +181,10 @@ my class Mu { # declared in BOOTSTRAP
}
}
elsif nqp::iseq_i($code, 11) {
X::Attribute::Required.new(name =>
nqp::p6box_s(nqp::atpos($task, 2))
).throw;
my $attr_name = nqp::p6box_s(nqp::atpos($task, 2));
unless nqp::attrinited(self, nqp::atpos($task, 1), $attr_name) {
X::Attribute::Required.new(name => $attr_name).throw;
}
}
else {
die "Invalid BUILDALLPLAN";
Expand Down

0 comments on commit b484e3b

Please sign in to comment.