Skip to content

Commit

Permalink
Mark attribute accessors as invisible frames so the errors give the l…
Browse files Browse the repository at this point in the history
…ine number where we tried to access the attribute, not some useless one.
  • Loading branch information
jnthn committed Jul 19, 2010
1 parent b62db16 commit c0df20c
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/metamodel/Attribute.nqp
Original file line number Diff line number Diff line change
Expand Up @@ -63,13 +63,19 @@ method compose($package) {

# Generate an accessor, if we need one.
if $!has_accessor {
# Accessor helper subs.
# Accessor helper subs. We make sure they are surrounded
# by annotations to make the backtrace printer ignore them,
# or otherwise we get line numbers from this file, which is
# totally useless to the dear programmer trying to debug their
# codez.
sub dummy_1() { Q:PIR { .annotate 'invizible_frame', 1 }; }
sub accessor_helper_ro($self) {
pir::new__PsP('Perl6Scalar', pir::getattribute__PPS($self, $name))
}
sub accessor_helper_rw($self) {
pir::getattribute__PPS($self, $name)
}
sub dummy_2() { Q:PIR { .annotate 'invizible_frame', 0 }; }
# XXX check there isn't already one...
Expand Down

0 comments on commit c0df20c

Please sign in to comment.