Re: setImmediate

2013-08-09 Thread Jorge Chamorro
On 08/08/2013, at 15:55, David Bruant wrote: This is not a Trying to protect us from ourselves situation. This is a browser trying to protect users from any sort of abuse situation. For while loops, they implemented the script takes too long dialog. For mistakenly infinitely nested too

RE: setImmediate

2013-08-09 Thread Ron Buckton
For promises using microtasks, one possibility I've been experimenting with in my polyfill is a Promise.yield() method that returns a Promise that resolves after the next time the UI thread gets a chance to drain its event queue (either through requestAnimationFrame or setTimeout). While it

Refutable destructuring

2013-08-09 Thread Axel Rauschmayer
AFAICT, there is no current consensus on whether destructuring assignment is refutable by default or not: https://github.com/rwldrn/tc39-notes/blob/master/es6/2013-07/july-23.md#44-consider-deferring-es6-refutable-matching Could we make destructuring assignment fail soft and introduce a marker

RE: Refutable destructuring

2013-08-09 Thread Domenic Denicola
Woah. I was sad about the loss of refutable destructuring, i.e. I would rather have had it by default, but this idea is a pretty brilliant way to make lemonade out of lemons. I would *love* a way to declaratively specify required parameters. ___

Re: Refutable destructuring

2013-08-09 Thread Rick Waldron
On Fri, Aug 9, 2013 at 5:54 PM, Axel Rauschmayer a...@rauschma.de wrote: AFAICT, there is no current consensus on whether destructuring assignment is refutable by default or not:

Re: Refutable destructuring

2013-08-09 Thread Axel Rauschmayer
While I agree this is interesting and should be explored further, I reject the proposal to add more meaning to the ! character. Given this proposal, ! would sometimes mean not or negate (as in it's current form) and sometimes mean a required thing. Meanwhile, refute is a synonym for

Re: Refutable destructuring

2013-08-09 Thread Brandon Benvie
On 8/9/2013 3:36 PM, Axel Rauschmayer wrote: let { +a: foo, b: bar } = { a: 1 }; // foo = 1, b = undefined let { +a: foo, b: bar } = { }; // exception function bla(+mandatoryArg, optionalArg1, optionalArg2 = 123) { ... } I presume these would also be valid, and do

Re: Refutable destructuring

2013-08-09 Thread Brendan Eich
On Aug 9, 2013, at 3:32 PM, Rick Waldron waldron.r...@gmail.com wrote: On Fri, Aug 9, 2013 at 5:54 PM, Axel Rauschmayer a...@rauschma.de wrote: AFAICT, there is no current consensus on whether destructuring assignment is refutable by default or not:

Re: Refutable destructuring

2013-08-09 Thread Allen Wirfs-Brock
On Aug 9, 2013, at 2:58 PM, Domenic Denicola wrote: Woah. I was sad about the loss of refutable destructuring, i.e. I would rather have had it by default, but this idea is a pretty brilliant way to make lemonade out of lemons. I would *love* a way to declaratively specify required

Re: Refutable destructuring

2013-08-09 Thread Rick Waldron
On Fri, Aug 9, 2013 at 6:40 PM, Brendan Eich bren...@mozilla.com wrote: On Aug 9, 2013, at 3:32 PM, Rick Waldron waldron.r...@gmail.com wrote: On Fri, Aug 9, 2013 at 5:54 PM, Axel Rauschmayer a...@rauschma.de wrote: AFAICT, there is no current consensus on whether destructuring assignment

Re: Refutable destructuring

2013-08-09 Thread Brandon Benvie
On 8/9/2013 4:03 PM, Allen Wirfs-Brock wrote: const MUST = () = {throw TypeError(Missing required parameter}; function foo (a=MUST(), b, c) {...} But that doesn't work for: ```js function foo({ a } = { a: MUST() }){} foo({}); // doesn't throw function bar({ +a }){} bar({}); // would throw

Re: Refutable destructuring

2013-08-09 Thread Allen Wirfs-Brock
On Aug 9, 2013, at 4:21 PM, Brandon Benvie wrote: On 8/9/2013 4:03 PM, Allen Wirfs-Brock wrote: const MUST = () = {throw TypeError(Missing required parameter}; function foo (a=MUST(), b, c) {...} But that doesn't work for: ```js function foo({ a } = { a: MUST() }){} this would

Re: Refutable destructuring

2013-08-09 Thread Allen Wirfs-Brock
On Aug 9, 2013, at 5:37 PM, Allen Wirfs-Brock wrote: On Aug 9, 2013, at 4:21 PM, Brandon Benvie wrote: On 8/9/2013 4:03 PM, Allen Wirfs-Brock wrote: const MUST = () = {throw TypeError(Missing required parameter}; function foo (a=MUST(), b, c) {...} But that doesn't work for:

Re: Refutable destructuring

2013-08-09 Thread Brandon Benvie
On 8/9/2013 5:45 PM, Allen Wirfs-Brock wrote: and if we make U+2639 a special token that evaluated to throw TypeError we could say function foo( {a=☹ }) {} This would be awesome. ___ es-discuss mailing list es-discuss@mozilla.org

Re: Refutable destructuring

2013-08-09 Thread Brendan Eich
Rick Waldron wrote: My argument was specifically about the current meaning of the ascii exclamation ! and that assigning it an additional context-based meaning that's quite the opposite of the current unary operator meaning, Ok, and I'm with you (recall Mark M. wants ! as