MozRepl::Plugin::Repl::Back - Back to previous context


MozRepl documentation Contained in the MozRepl distribution.

Index


Code Index:

NAME

Top

MozRepl::Plugin::Repl::Back - Back to previous context

VERSION

Top

version 0.01

SYNOPSIS

Top

    use MozRepl;

    my $repl = MozRepl->new;
    $repl->setup({ plugins => { plugins => [qw/Repl::Enter Repl::Back/] } });

    $repl->repl_enter({ source => "window" });
    $repl->repl_enter({ source => "gBrowser" });
    $repl->repl_enter({ source => "contentWindow" });
    print $repl->repl_back(); ### gBrowser/[object XULElement]
    print $repl->repl_back(); ### window/[object ChromeWindow]

DESCRIPTION

Top

Add repl_back() method to MozRepl.

METHODS

Top

execute($ctx, $args)

Back to previous context.

SEE ALSO

Top

MozRepl::Plugin::Base
MozRepl::Plugin::Repl::Enter
MozRepl::Plugin::Repl::Home

AUTHOR

Top

Toru Yamaguchi, <zigorou@cpan.org>

BUGS

Top

Please report any bugs or feature requests to bug-mozrepl-plugin-repl-back@rt.cpan.org, or through the web interface at http://rt.cpan.org. I will be notified, and then you'll automatically be notified of progress on your bug as I make changes.

COPYRIGHT & LICENSE

Top


MozRepl documentation Contained in the MozRepl distribution.
package MozRepl::Plugin::Repl::Back;

use strict;
use warnings;

use base qw(MozRepl::Plugin::Base);

our $VERSION = '0.01';

sub execute {
    my ($self, $ctx, $args) = @_;

    my $cmd = $self->process('execute', { repl => $ctx->repl });
    return "" . $ctx->execute($cmd);
}

1; # End of MozRepl::Plugin::Repl::Back

__DATA__
__execute__
[% repl %].back();
__END__