in reply to Re^4: MozRepl/Client.pm does not support firefox 7.0
in thread MozRepl/Client.pm does not support firefox 7.0

The (ugly) change is that eval "function() {}"; does not return an anonymous function in Javascript (on Firefox 7) anymore

How odd. I remember that being a bug once in firefox2/3

What if you use return function(){};?

Replies are listed 'Best First'.
Re^6: MozRepl/Client.pm does not support firefox 7.0
by Corion (Patriarch) on Sep 23, 2011 at 15:15 UTC

    I don't know how (in Javascript) eval and return interact. It might be worth investigating if the problem comes up again in a different place.

    So far, there is only one piece in MozRepl::RemoteObject needing functions, the implementation of ->declare(), and that one was easily patched to support the temporary assignment to a variable. Changing the Javascript code to become eval "return $expr" does not work in the general case because $expr is allowed to contain multiple statements. I don't want to implement a JS parser just to find the last statement in some block and put the return before it, so I just change the call sites of that code instead.