in reply to Re^2: MozRepl/Client.pm does not support firefox 7.0
in thread MozRepl/Client.pm does not support firefox 7.0
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?
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^4: MozRepl/Client.pm does not support firefox 7.0
by Corion (Patriarch) on Sep 23, 2011 at 07:25 UTC | |
by Anonymous Monk on Sep 23, 2011 at 14:16 UTC | |
by Corion (Patriarch) on Sep 23, 2011 at 15:15 UTC | |
|
Re^4: MozRepl/Client.pm does not support firefox 7.0
by Anonymous Monk on Sep 23, 2011 at 04:22 UTC |