I dive out the problem might be that firefox 7 does not support anonymous functions.
sub browser { my ($self,$repl) = @_; $repl ||= $self->repl; print "repl: $repl\n"; return $repl->declare(<<'JS')->(); function () { var wm = Components.classes["@mozilla.org/appshell/window-medi +ator;1"] .getService(Components.interfaces.nsIWindow +Mediator); var win = wm.getMostRecentWindow('navigator:browser'); if (! win) { // No browser windows are open, so open a new one. win = window.open('about:blank'); }; return win.gBrowser //return win.getBrowser() } JS }; sub declare { my ($self,$js,$context) = @_; print "1:$self; 2:$js;3:$context\n "; if (! $self->{functions}->{$js}) { $self->{functions}->{$js} = $self->expr($js); # Weaken the backlink of the function my $res = $self->{functions}->{$js}; my $ref = ref $res; bless $res, "$ref\::HashAccess"; weaken $res->{bridge}; $res->{return_context} = $context; bless $res => $ref; }; $self->{functions}->{$js} };
If I manually change the function () to function abc(), then repl can not get any references:
Can't bless non-reference value at C:/Perl/site/lib/MozRepl/RemoteObject.pm
How to solve this issue?
In reply to Re^3: MozRepl/Client.pm does not support firefox 7.0
by seven_shen
in thread MozRepl/Client.pm does not support firefox 7.0
by seven_shen
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |