Proposal: Static sort method on Array

2018-04-07 Thread Rob Ede
I don't like the fact the only way to sort is in-place with Array#sort and I can't be the first to feel this way or wonder why there isn't a built-in solution. Obviously, searching "javascript array.sort" doesn't produce any helpful results to see if someone has suggested this before since all

Re: JSON support for BigInt in Chrome/V8

2018-07-17 Thread Rob Ede
The way I see it is that JSON is kind of a thing by itself even without JavaScript and we shouldn’t be beholden to the JS syntax of representing Bigints (123n vs 123) in JSON. I think changing the behaviour of JSON.parse and introducing JSON5 namespace (or whatever) are both on the right track

Re: JSON support for BigInt in Chrome/V8

2018-07-29 Thread Rob Ede
+1 on getting this sorted before stage 4 As people have said before, JSON already supports BigInts. We of course need to preserve backwards compatibility with JS and try not to break how other languages use JSON. I think the best way to satisfy everyone is to give ourselves some flexibility go

Re: Math.roundUp(), an alias for Math.ceil()

2018-08-04 Thread Rob Ede
Hi Eric, From my experience, folks don’t like adding things to the spec that are very easily implemented (like aliases) in userland. All you’d need is a `Math.roundUp = Math.ceil` to start using the code you want. Regards, Rob > On 4 Aug 2018, at 23:55, Eric Andrew Lewis > wrote: > > Hi ther

Re: Proposal: `maxDepth` on objects

2018-10-22 Thread Rob Ede
Calculating this on plain objects could be a O(1) operation: Empty objects are initialized with maxDepth 0 and are set to 1 when a primitive property is added. If an object property is added the maxDepth is set to 1 + maxDepth(newObjectProperty)`instead of it being calculated Ïevery time .maxDe

Re: Proposal: `maxDepth` on objects

2018-10-22 Thread Rob Ede
built-in.) > On 22 Oct 2018, at 11:03, Tab Atkins Jr. wrote: > > On Mon, Oct 22, 2018 at 2:42 AM Rob Ede wrote: >> Calculating this on plain objects could be a O(1) operation: >> >> Empty objects are initialized with maxDepth 0 and are set to 1 when a >> prim

Re: Syntax operator for "default assignment if value doesn't exits"

2019-01-12 Thread Rob Ede
pretty succinct with existing de-structuring syntax: ``` const [variable = defaultValue] = [maybeUndefinedValue] const fn = ({ key = defaultValue }) => { console.log(key); } ``` > On 11 Jan 2019, at 12:00, es-discuss-requ...@mozilla.org wrote: > > Send es-discuss mailing list submissions to >

Re: Syntax operator for "default assignment if value doesn't exits"

2019-01-12 Thread Rob Ede
olyfill] = [Symbol] >> >> This is specifically why convention is to use: >> >> typeof maybeUndefinedValue === 'undefined' >> >> >const fn = ({ key = defaultValue }) => { console.log(key); } >> >> The second example doesn't

Re: Re: Proposal For A New Alternative Keyword To “this” For Classes

2019-03-11 Thread Rob Ede
I would imagine that this can be achieved with bind operator proposal, which already has Babel support, despite no examples showing usage inside a class. Something like: `oReq.addEventListener("load", ::this.responseHandler);` seems to be the syntax that will de-sugar to `oReq.addEventListener("l