package MozRepl::Plugin::JSON;
use strict;
use warnings;
use base qw(MozRepl::Plugin::Base);
use Carp::Clan qw(croak);
=head1 NAME
MozRepl::Plugin::JSON - To JSON string plugin.
=head1 VERSION
up({ plugins => { plugins => [qw/JSON/] } });
print $repl->json({ source => MozRepl::Util->javascript_value({foo => 1, bar => 2}) });
=head1 DESCRIPTION
Add json() method to L<MozRepl>.
=head1
METHODS
=head2 setup($ctx, $args)
Load script at http://www.thomasfrank.se/downloadableJS/jsonStringify.js
=cut
sub setup {
my ($self, $ctx, $args) = @_;
$ctx->execute($self->process('set