Hi again, Yes, that's right, your example works, mine is wrong. However I tried to use my already correctly written generators in separate modules and they work now with http://www.softwareishard.com/temp/firebug-1.10.0a6newloader1.xpi ! I installed the official Firebug 1.10a6 and it did not work with it. Will http://www.softwareishard.com/temp/firebug-1.10.0a6newloader1.xpi become official?
Best regards, Dido On Tue, Apr 3, 2012 at 9:50 AM, Jan Honza Odvarko <[email protected]> wrote: > I think your example is wrong: > > See another one (works for me): > > function simpleGenerator(){ > yield "first"; > yield "second"; > yield "third"; > for (var i = 0; i < 3; i++) > yield i; > } > > var g = simpleGenerator(); > FBTrace.sysout(g.next()); // prints "first" > FBTrace.sysout(g.next()); // prints "second" > FBTrace.sysout(g.next()); // prints "third" > FBTrace.sysout(g.next()); // prints 0 > FBTrace.sysout(g.next()); // prints 1 > FBTrace.sysout(g.next()); // prints 2 > FBTrace.sysout(g.next()); // StopIteration is thrown > > Does this one work for you? > > Honza > > On Apr 3, 8:33 am, Deqn Stoqnov <[email protected]> wrote: >> Hi, >> >> With firebug-1.10.0a6newloader1.xpi this exception occurs now - >> EXCEPTION in Events.dispatch initialize: TypeError: g.next is not a >> function in chrome://hellobootamd/content/myModule.js:32 >> On this line : FBTrace.sysout(g.next()); >> In the attachment is the tracing-log. >> >> Best regards, >> Dido >> >> On Mon, Apr 2, 2012 at 9:52 PM, Jan Honza Odvarko <[email protected]> wrote: >> >> >> >> >> >> >> >> > Please, try my experimental build here: >> >http://www.softwareishard.com/temp/firebug-1.10.0a6newloader1.xpi >> >> > ...and let me know if it works for you >> >> > Honza >> >> > On Apr 2, 5:20 pm, dido <[email protected]> wrote: >> >> Hi all, >> >> >> I took the latest HelloBootAMD example(https://github.com/firebug/ >> >> extension-examples/) and tried to rewrite already existing FB >> >> extension around it. At the very end of the initialize method of >> >> MyModule I added just this : >> >> ///////////////////////////////////// >> >> var g = function(){ >> >> yield 1;} >> >> >> FBTrace.sysout(g.next()); >> >> ////////////////////////////////////// >> >> This gave me the following warning: >> >> ///////////////////////////////////// >> >> errors.observe showChromeMessages off, dropped: [JavaScript Warning: >> >> "yield is a reserved identifier" {file: "chrome://hellobootamd/content/ >> >> myModule.js" line: 29 column: 7 source: " >> >> yield 1; >> >> "}] >> >> //////////////////////////////////// >> >> Nothing logged in FBTrace. This is an attempt to reproduce a greater >> >> problem in which I can't use generators defined in separate AMD module >> >> imported in modules that inherit from Firebug.Module and >> >> Firebug.Panel. Or "yield is undefined" or "<name_of_my_class> is not a >> >> constructor" occur in this case. >> >> >> Any ideas ? >> >> >> Best regards, >> >> Dido >> >> > -- >> > You received this message because you are subscribed to the Google >> > Groups "Firebug" group. >> > To post to this group, send email to [email protected] >> > To unsubscribe from this group, send email to >> > [email protected] >> > For more options, visit this group at >> >https://groups.google.com/forum/#!forum/firebug >> >> >> >> firebug-tracing-logs.ftl >> 68KViewDownload > > -- > You received this message because you are subscribed to the Google > Groups "Firebug" group. > To post to this group, send email to [email protected] > To unsubscribe from this group, send email to > [email protected] > For more options, visit this group at > https://groups.google.com/forum/#!forum/firebug -- You received this message because you are subscribed to the Google Groups "Firebug" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at https://groups.google.com/forum/#!forum/firebug
