Re: RegExp.escape

2015-06-12 Thread Benjamin Gruenaum
be awesome! -- kangax On Fri, Jun 12, 2015 at 2:52 PM, Benjamin Gruenaum benjami...@gmail.com wrote: You know what? Why not. I'm going to try to champion this. I talked to Domenic and he said he's willing to help me with this which is a big help (this would be my first time). I'll open

Re: `new Object` vs `Object` difference

2015-06-12 Thread Benjamin Gruenaum
, 2015, at 1:19 PM, Benjamin Gruenaum wrote: Ok, so I gave this a few hours in the open. So, I'm looking at the ES5 specification (also checked the current ES draft which is similar) at the definition of what new Object and Object do. To my surprise: - `new Object` describes a whole algorithm

Re: `new Object` vs `Object` difference

2015-06-12 Thread Benjamin Gruenaum
the same ... since, about, ever. Agreed if that's actually indeed the case, we could have just one definition for those 3 constructors (not just Object) Regards On Fri, Jun 12, 2015 at 10:19 PM, Benjamin Gruenaum benjami...@gmail.com wrote: Ok, so I gave this a few hours in the open. So

`new Object` vs `Object` difference

2015-06-12 Thread Benjamin Gruenaum
Ok, so I gave this a few hours in the open. So, I'm looking at the ES5 specification (also checked the current ES draft which is similar) at the definition of what new Object and Object do. To my surprise: - `new Object` describes a whole algorithm of how the object constructor works - treating

Re: RegExp.escape

2015-06-12 Thread Benjamin Gruenaum
You know what? Why not. I'm going to try to champion this. I talked to Domenic and he said he's willing to help me with this which is a big help (this would be my first time). I'll open a GitHub repo and see what I can come up with. ___ es-discuss

Re: RegExp.escape

2015-06-12 Thread Benjamin Gruenaum
Reviving this, a year passed and I think we still want this. We have even more validation than we had a year ago (added by libraries like lodash) and this is still useful. What would be the required steps in order to push this forward to the ES2016 spec?

Re: When should we define a function as async

2015-06-03 Thread Benjamin Gruenaum
If you want a special Promise (subclass or extended), you should not use async function since it casts the return value to a standard Promise Right, there was a proposal that let you override how await works ( https://github.com/jhusain/compositional-functions) but I don't think it's currently

Re: When should we define a function as async

2015-06-03 Thread Benjamin Gruenaum
A function needs to be defined `async` if you intend to possibly use the await keyword inside it. If a function is returning Promise, it MUST be async If a function depends on an async function, it **MUST be async A further question could be, if one function only contains some simple then calls

Re: Promise sub-class: super((resolve, reject) = this) ?

2015-06-03 Thread Benjamin Gruenaum
Am I missing something obvious in `super((resolve, reject) = this)` ? First of all, it makes perfect sense for `this` not work work before super has been called - and it has not been called yet. I think that the crux is that the promise constructor runs _synchronously_ so when you pass it `this`

Actual WeakSet Use Cases

2015-06-02 Thread Benjamin Gruenaum
So umm... not to be annoying but I've been digging through esdiscuss and various blog posts online. I couldn't really find any use case for WeakSet (plenty of threads about naming things :P). Most material about it online fails to distinguish it from what one would use a regular Set for. All the

Re: Actual WeakSet Use Cases

2015-06-02 Thread Benjamin Gruenaum
Thanks Domenic, Elaborating on your example with more details. Let's say you need to make sure at a certain point that an object has not been tinkered with by user code (for security reasons). You can't check the prototype or a symbol since those can be faked and you can't keep a regular `Set`

Re: Proposal to add EventEmitter to core [ES7]

2015-06-01 Thread Benjamin Gruenaum
Note that when/if observables land we get an event-emitter mechanism in the language anyway. ___ es-discuss mailing list es-discuss@mozilla.org https://mail.mozilla.org/listinfo/es-discuss

Re: Re: Consider javascript already support for default parameters, so maybe we can use the default parameter to specify the strong type.

2015-05-18 Thread Benjamin Gruenaum
What about non-default parameters? ___ es-discuss mailing list es-discuss@mozilla.org https://mail.mozilla.org/listinfo/es-discuss