Bug#551251: libjavascript-perl: FTBFS: failed test

Mike Hommey mh at glandium.org
Sat Oct 24 14:01:13 UTC 2009


On Sat, Oct 24, 2009 at 02:48:37PM +0200, Mike Hommey wrote:
> On Fri, Oct 16, 2009 at 10:31:23PM +0200, gregor herrmann wrote:
> > From t/21-branch-handler.t:
> > 
> > 22 $cx1->set_branch_handler(\&branch_handler);
> > 23 $cx1->eval("for(i = 0; i < 10; i++) {}");
> > 24 is($called, 10);
> > 
> > 
> > Hm, I guess it's not that easy :)
> 
> It's actually almost that easy. You should also change the
> PJS_branch_handler definition to drop its second argument.
> 
> As for the test, with the API change, the assumption that the "branch"
> handler is going to be called at each for iteration becomes wrong, which
> is why the test fails.
> 
> Unfortunately, while I have been able to verify that indeed the callback
> is properly called by the JS engine if I hack the JSContext members to
> make it happen, I couldn't get it to trigger under normal conditions
> with an eval()ed script :(

After further investigation, it appears it is not triggered at all, at
the application itself has to trigger it with
JS_TriggerOperationCallback.

See
http://groups.google.com/group/mozilla.dev.tech.js-engine/browse_thread/thread/a4d1fe147761aacb/e61d2592faf4ef72?lnk=gst&q=js_setoperationcallback#e61d2592faf4ef72
for reference.

Mike



More information about the pkg-mozilla-maintainers mailing list