Re: Re: Existential Operator / Null Propagation Operator

2016-09-30 Thread Kagami Rosylight
Is the only problem here is the parser problem with `obj.prop?.2:.1`? Then how about `??. ` instead of `?.`? >Once upon a time, there was a fascinating proposal on this subject: Why are you posting twice? :/ ___ es-discuss mailing list

Proposal: anaphoric if and while syntax

2016-09-30 Thread Danielle McLean
In current ECMAScript, it is legal to place a variable declaration inside the initialiser of a `for` loop, as well as to declare the variable used by a `for...in` or `for...of` loop within the declaring expression:     for (let i = 0; i < 5; ++i) console.log(i);     for (let item of collection)

Re: Add an option to omit prototype of objects created by JSON.parse()?

2016-09-30 Thread Jordan Harband
``` JSON.parse(str, (k, b) => { if (v && typeof v === 'object' && !Array.isArray(v)) { return Object.create(null, Object.getOwnPropertyDescriptors(v)); } return v; }); ``` On Mon, Sep 19, 2016 at 1:13 AM, 段垚 wrote: > Hi, > > It is usually a bad practice to let a map

Add an option to omit prototype of objects created by JSON.parse()?

2016-09-30 Thread 段垚
Hi, It is usually a bad practice to let a map object (an plain object used as a key-value map) have a prototype. Objects created by JSON.parse() have a prototype by default, and we can get rid of them by: JSON.parse(str, function(k, v) { if (v && typeof v === 'object' &&

Re: Support () => {}() syntax?

2016-09-30 Thread Tab Atkins Jr.
On Fri, Sep 30, 2016 at 7:23 AM, Allen Wirfs-Brock wrote: > On Sep 30, 2016 6:10 AM, Kevin Smith wrote: >> Ideally there will be an `async` version of do expressions, which evaluate >> to a promise: >> >> ``` >> let promise = async do { >> await

Re: Support () => {}() syntax?

2016-09-30 Thread Allen Wirfs-Brock
On Sep 30, 2016 6:10 AM, Kevin Smith wrote: > > Ideally there will be an `async` version of do expressions, which evaluate to a promise: > > ``` > let promise = async do { >   await something(); > }; > ``` > > (BTW, if we get such a thing, we might not really need

Re: Support () => {}() syntax?

2016-09-30 Thread Kevin Smith
Ideally there will be an `async` version of do expressions, which evaluate to a promise: ``` let promise = async do { await something(); }; ``` (BTW, if we get such a thing, we might not really need top-level-module-await...) On Fri, Sep 30, 2016 at 2:39 AM Olivier Lalonde

Feature Request: Make ECMA262 a superset of JSON

2016-09-30 Thread Raul-Sebastian Mihăilă
Disregard my reply as it doesn't make sense. :-) ___ es-discuss mailing list es-discuss@mozilla.org https://mail.mozilla.org/listinfo/es-discuss

Feature Request: Make ECMA262 a superset of JSON

2016-09-30 Thread Raul-Sebastian Mihăilă
Step 4 of http://www.ecma-international.org/ecma-262/7.0/index.html#sec-json.parse says that `__proto__` shouldn't have special meaning when parsing. ___ es-discuss mailing list es-discuss@mozilla.org https://mail.mozilla.org/listinfo/es-discuss

Re: Feature Request: Make ECMA262 a superset of JSON

2016-09-30 Thread Claude Pache
Besides U+2028 and U+2029, there is also the __proto__ key, which has a special meaning in JS as implemented in browser. That prevents definitely to "safely" embed arbitrary JSON within JS. —Claude > Le 29 sept. 2016 à 23:21, Richard Gibson a écrit : > > ECMAScript

Re: Support () => {}() syntax?

2016-09-30 Thread Olivier Lalonde
Do "do expressions" support the "await" keyword? On Thu, Sep 29, 2016 at 3:59 PM, Rick Waldron wrote: > > > On Thu, Sep 29, 2016 at 3:14 PM Michał Wadas > wrote: > >> Similar proposal is already here, do expressions. >> > > Additionally... > >> >>