Skip to content

Commit

Permalink
add hidden_from_backtrace trait
Browse files Browse the repository at this point in the history
  • Loading branch information
moritz committed Aug 22, 2011
1 parent 3b66c0f commit 19cfd13
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/core/control.pm
Expand Up @@ -133,7 +133,7 @@ my &lastcall := -> {
True
};

sub die(*@msg) { pir::die__0P(@msg.join('')) }
sub die(*@msg) is hidden_from_backtrace { pir::die__0P(@msg.join('')) }

sub eval(Str $code, :$lang = 'perl6') {
my $caller_ctx := Q:PIR {
Expand Down
8 changes: 7 additions & 1 deletion src/core/traits.pm
Expand Up @@ -23,7 +23,6 @@ multi trait_mod:<is>(Attribute:D $attr, :$readonly!) {
multi trait_mod:<is>(Routine:D $r, :$rw!) {
$r.set_rw();
}

multi trait_mod:<is>(Parameter:D $param, :$readonly!) {
# This is the default.
}
Expand Down Expand Up @@ -89,6 +88,13 @@ multi trait_mod:<of>(Routine:D $target, Mu:U $type) {
$target.signature.set_returns($type)
}

multi trait_mod:<is>(Routine:D $r, :$hidden_from_backtrace!) {
$r.HOW.mixin($r, role {
method is_hidden_from_backtrace { True }
});
}


proto trait_mod:<returns>(|$) { * }
multi trait_mod:<returns>(Routine:D $target, Mu:U $type) {
$target.signature.set_returns($type)
Expand Down
2 changes: 1 addition & 1 deletion tools/build/Makefile.in
Expand Up @@ -142,6 +142,7 @@ CORE_SOURCES = \
src/core/Callable.pm \
src/core/stubs.pm \
src/core/natives.pm \
src/core/Sub.pm \
src/core/control.pm \
src/core/Mu.pm \
src/core/Stringy.pm \
Expand All @@ -150,7 +151,6 @@ CORE_SOURCES = \
src/core/WhateverCode.pm \
src/core/Block.pm \
src/core/Routine.pm \
src/core/Sub.pm \
src/core/Method.pm \
src/core/Submethod.pm \
src/core/Attribute.pm \
Expand Down

0 comments on commit 19cfd13

Please sign in to comment.