Skip Menu |

This queue is for tickets about the WWW-Mechanize-FireFox CPAN distribution.

Report information
The Basics
Id: 127053
Status: resolved
Priority: 0/
Queue: WWW-Mechanize-FireFox

People
Owner: Nobody in particular
Requestors: cpanrt [...] edsantiago.com
Cc:
AdminCc:

Bug Information
Severity: Important
Broken in: 0.79
Fixed in: (no value)



Subject: MozRepl::RemoteObject: TypeError: invalid 'in' operand obj
new() fails immediately with: MozRepl::RemoteObject: TypeError: invalid 'in' operand obj at /usr/local/share/perl/5.24.1/MozRepl/RemoteObject.pm line 849. More verbosely: $ PERL5OPT=MCarp=verbose perl -MWWW::Mechanize::Firefox -e 'WWW::Mechanize::Firefox->new' MozRepl::RemoteObject: TypeError: invalid 'in' operand obj at /usr/local/share/perl/5.24.1/MozRepl/RemoteObject.pm line 849. MozRepl::RemoteObject::js_call_to_perl_struct(MozRepl::RemoteObject=HASH(0x57f2ff7c), "repl.dive(4,[\"linkedBrowser\",\"contentWindow\",\"document\",\"body"..., undef) called at /usr/local/share/perl/5.24.1/MozRepl/RemoteObject.pm line 288 MozRepl::RemoteObject::unjson(MozRepl::RemoteObject=HASH(0x57f2ff7c), "repl.dive(4,[\"linkedBrowser\",\"contentWindow\",\"document\",\"body"...) called at /usr/local/share/perl/5.24.1/MozRepl/RemoteObject/Methods.pm line 299 MozRepl::RemoteObject::Methods::dive(MozRepl::RemoteObject::Instance=HASH(0x585783f4), "linkedBrowser", "contentWindow", "document", "body") called at /usr/local/share/perl/5.24.1/WWW/Mechanize/Firefox.pm line 222 WWW::Mechanize::Firefox::new("WWW::Mechanize::Firefox") called at -e line 1 Instrumenting RemoteObject.pm, the more complete error seems to be: {"status":"error","name":"TypeError","message":"invalid 'in' operand obj","command":"repl.dive(4,[\"linkedBrowser\",\"contentWindow\",\"document\",\"body\"])\n"} firefox-esr:i386/stretch 52.9.0esr-1~deb9u1 on Debian. Thanks in advance for your attention. This module has been invaluable the past many years; I'm hoping this is an easy fix.
Subject: Re: [rt.cpan.org #127053] MozRepl::RemoteObject: TypeError: invalid 'in' operand obj
Date: Thu, 6 Sep 2018 23:02:41 +0200
To: bug-WWW-Mechanize-FireFox [...] rt.cpan.org
From: Max Maischein <corion [...] corion.net>
Hello Eduardo, it's always great to hear from users of my module! I have Firefox 52.9.0 ESR to test this and I can't replicate the error with the versions I have, so I'm basically guessing here: Can you change the offending line in MozRepl/RemoteObject.pm to: if (e in obj) { Maybe that fixes it already? Otherwise, I think you're on your own as I don't know why Mozilla would change the Javascript parser and why things would change on an ESR version... repl.dive = function(id,elts) { var obj = repl.getLink(id); var last = "<start object>"; for (var idx=0;idx <elts.length; idx++) { var e = elts[idx]; // because "in" doesn't seem to look at inherited properties?? if (e in obj) { last = e; obj = obj[ e ]; } else { throw "Cannot dive: " + last + "." + e + " is empty."; }; }; return obj }; -max
I would love to try that; I am now, however, unable to reproduce my own problem. It's working again, and I have no idea what has changed (different shell, different cwd. Slightly different phase of the moon.) I'm baffled. I'm stepping back now to see if distance gives me perspective. Thank you so, so much for your quick response and above all for your work on this module.