Legacy generator function is no longer allowed in method definitions

Published: | Categories: JavaScript


Previously, it was possible to use the yield keyword in a method definition’s getter to make it implicitly a legacy generator function. This is not valid according to the current ECMAScript spec, and therefore Firefox now raises a SyntaxError. Use generator methods instead, as explained in this newsgroup post.