Path: csiph.com!2.eu.feeder.erje.net!feeder.erje.net!1.eu.feeder.erje.net!news.albasani.net!weretis.net!feeder1.news.weretis.net!news.solani.org!.POSTED!not-for-mail From: Thomas 'PointedEars' Lahn Newsgroups: comp.lang.javascript Subject: Re: Wait on keyboard Date: Sat, 12 Mar 2016 14:44:57 +0100 Organization: PointedEars Software (PES) Lines: 36 Message-ID: <1842824.xj4pi0fp9G@PointedEars.de> References: <6ef267d6-7655-4699-9363-d6e0f613f899@googlegroups.com> <9658502.p6PyTM0SGn@PointedEars.de> Reply-To: Thomas 'PointedEars' Lahn Mime-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 8Bit X-Trace: solani.org 1457790299 16099 eJwNycEBwCAIA8CVihAC49go+4/Q3vfgaSlGIgODOb16si4l24x+FdKgaq3/D0E+t932eGdhPiHOEPw= (12 Mar 2016 13:44:59 GMT) X-Complaints-To: abuse@news.solani.org NNTP-Posting-Date: Sat, 12 Mar 2016 13:44:59 +0000 (UTC) User-Agent: KNode/4.14.2 X-User-ID: eJwNxMEBwCAIA8CVsEKC4wg0+4/Q3uNiY6HpCHgolCm7NY+/M9Qp0YLMrju+ey2vwj1Ux0YDdpKpol72v/EDc5cWRA== Cancel-Lock: sha1:sTRqpeoH5zFBBTPkl2AG8sGEZbY= X-NNTP-Posting-Host: eJwFwYEBwCAIA7CXxLWA5zAs/59gws/NO+B0cDh1Qky1LXaWfg0XsKuVWaGrukfNsx0w0h40ghGc Xref: csiph.com comp.lang.javascript:29934 Stefan Weiss wrote: > On 03/12/2016 04:44, Thomas 'PointedEars' Lahn wrote: >> Stefan Weiss wrote: >>> With a little generator magic, you can make individual functions >>> pause-able: >>> >>> var jonas = S(function* (start, max) >> >> In which ECMAScript implementation is this not a syntax error, and if >> there is any, what does it mean there? > > That's the generator function syntax: > http://www.ecma-international.org/ecma-262/6.0/#sec-generator-function-definitions > https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/function* > > It's supported by current versions of Firefox, Chrome, Edge (with the > experimental flag), and others: > http://kangax.github.io/compat-table/es6/#test-generators_basic_functionality Fascinating. I would have thought that generator functions (which had been introduced with JavaScript 1.7, but not specified before ECMAScript 2015) would not require additional syntax except the “yield” keyword. However unfortunately, apparently Ecma-TC39 settled for specifying a backwards- incompatible approach as it works in JavaScript 38 even without the asterisk as it did since version 1.7. pp. -- PointedEars FAQ: | SVN: Twitter: @PointedEars2 | ES Matrix: Please do not cc me. / Bitte keine Kopien per E-Mail.