Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Implement Promise.Bool.
  • Loading branch information
jnthn committed Oct 31, 2013
1 parent b83de34 commit c1064c7
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/vm/jvm/core/Threading.pm
Expand Up @@ -337,6 +337,10 @@ my class Promise {
so $!status == any(Broken, Kept)
}

multi method Bool(Promise:D:) {
self.has_result
}

method cause(Promise:D:) {
if $!status == Broken {
$!result
Expand Down

0 comments on commit c1064c7

Please sign in to comment.