Re: Reflect.hasOwn

2016-09-07 Thread Maël Nison
asOwnProperty`, so this wouldn't do much for me other > than saving a declaration in each file I use it. Honestly, though, I feel > it was a design flaw from the start to be on the prototype, but we can't > just time travel and fix it. > > On Tue, Sep 6, 2016, 16:42 Maël Nison <nison.m.

Re: Reflect.hasOwn

2016-09-06 Thread Maël Nison
JSON.parse() and object literals are big sources of objects-as-maps. In both of these cases, using the `in` operator won't give the right answer. Le mar. 6 sept. 2016 à 22:11, Domenic Denicola a écrit : > Reflect is a namespace that contains the proxy traps (it’s a bit of an >

Reflect.hasOwn

2016-09-06 Thread Maël Nison
Previous thread (2 years ago) here: https://esdiscuss.org/topic/reflect-hasown It is still incredibly common to check if an object contains a key using: if (Object.prototype.hasOwnProperty.call(myObject, key)) This syntax is quite verbose, and doesn't really make sense in the first place.

Re: Import wildcards

2016-05-29 Thread Maël Nison
crit : > Not exactly. To export a binding it must be declared in scope somewhere > which means it's statically analyzable within a given file. > On May 28, 2016 9:49 AM, "Maël Nison" <nison.m...@gmail.com> wrote: > >> I see, but unless I'm mistaken, the same issue occur

Re: Import wildcards

2016-05-28 Thread Maël Nison
> import * as constants from 'config'; > > > On Fri, May 27, 2016 at 10:00 AM Maël Nison <nison.m...@gmail.com> wrote: > >> Hi, >> >> In about every project I have, I write a file or two with this form: >> >> export let API_USERNAME = `name`

Import wildcards

2016-05-27 Thread Maël Nison
Hi, In about every project I have, I write a file or two with this form: export let API_USERNAME = `name` export let API_TOKEN = `token` // etc Most of the time, when I need one of those variables somewhere, I also need the other. It might be burdensome, since I end up with

Re: Re: Existential Operator / Null Propagation Operator

2015-10-29 Thread Maël Nison
As a side note, this feature has recently been added to Ruby (issue ). They use the "foo.?bar" syntax instead of "foo?.bar" because of a grammar conflict (ruby identifiers may end with an interrogation mark). Is there something wrong with the "foo?.bar"

Conditional catch

2015-04-11 Thread Maël Nison
Hi, Has the conditional catch clause https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/try...catch#Conditional_catch_clauses ever been considered for adoption in the standard? I've stumbled upon them while seeking if there was a better option than the classic if

System global

2015-04-08 Thread Maël Nison
Hi, Is the System global still on the ES6 roadmap ? I can't find any reference to it on the draft[1] (same with the Loader class). I was especially wondering how to define a module manually. SystemJS has something like `System.set`, but I was wondering where it was actually described in the

Re: System global

2015-04-08 Thread Maël Nison
, Maël Nison nison.m...@gmail.com wrote: Hi, Is the System global still on the ES6 roadmap ? I can't find any reference to it on the draft[1] (same with the Loader class). I was especially wondering how to define a module manually. SystemJS has something like `System.set`, but I was wondering

Re: Array.prototype.contains

2014-07-23 Thread Maël Nison
-- Maël Nison (arcanis https://twitter.com/arcanis) Frontend Developer @ Sketchfab ___ es-discuss mailing list es-discuss@mozilla.org https://mail.mozilla.org/listinfo/es-discuss

Range generator

2014-06-20 Thread Maël Nison
Hi, Is there plans to add a range generator to the standard library ? It would be especially useful with array comprehension, when initializing arrays : this._year = [ new Month(n) for n of Number.range(0, 12) ] -- Maël Nison (arcanis https://twitter.com/arcanis) Frontend Developer

Re: Range generator

2014-06-20 Thread Maël Nison
Btw, I used the wrong syntax in my precedent mail. It should be : [ for (n of Number.range(0, 12)) new Month(n) ] On 20 June 2014 11:24, Maël Nison nison.m...@gmail.com wrote: Hi, Is there plans to add a range generator to the standard library ? It would be especially useful

Module import syntax (leading / trailing from)

2014-06-11 Thread Maël Nison
if this point had been discussed before. Thanks, -- Maël Nison (arcanis https://twitter.com/arcanis) Frontend Developer @ Sketchfab ___ es-discuss mailing list es-discuss@mozilla.org https://mail.mozilla.org/listinfo/es-discuss

Current module path

2014-06-05 Thread Maël Nison
Hi, Will ES6 have a way to know what is the current module path from inside a module ? Such a thing could be useful to locate relative resources, just like node's __dirname global. -- Maël Nison (arcanis https://twitter.com/arcanis) Frontend Developer @ Sketchfab

Re: Mutable array methods

2012-03-19 Thread Maël Nison
waldron.r...@gmail.com wrote: On Thu, Mar 8, 2012 at 12:19 PM, David Bruant bruan...@gmail.com wrote: Le 08/03/2012 18:02, Maël Nison a écrit : Shouldn't native versions be more efficients ? I heard V8 is on the path of self-hosting (writing standard functions in JavaScript itself) as much

Mutable array methods

2012-03-08 Thread Maël Nison
map The alternative would be to use the forEach method using three arguments : var array = [ 0, 1, 42, 3, 4, 5, 42, 42, 42 ]; array.forEach( function ( x, i, a ) { a[ i ] = 42; } ); Is there a reason for these missing functions ? Thanks, -- Maël Nison Epitech 2014, Paris - http

Re: Mutable array methods

2012-03-08 Thread Maël Nison
Shouldn't native versions be more efficients ? On 8 March 2012 17:45, David Bruant bruan...@gmail.com wrote: Le 08/03/2012 13:02, Maël Nison a écrit : Hi, I'm just wondering why there is no mutable function with Javascript arrays. For exemple, if I want to remove every entry matching 42

Re: No code block without introductory keyword (was: Re: Boolean shortcuts)

2012-01-04 Thread Maël Nison
-- Maël Nison Epitech 2014, Paris - Astek ___ es-discuss mailing list es-discuss@mozilla.org https://mail.mozilla.org/listinfo/es-discuss

Re: Array.range() (was: Suggestion: Array.prototype.repeat)

2012-01-03 Thread Maël Nison
@mozilla.org https://mail.mozilla.org/listinfo/es-discuss -- Maël Nison Epitech 2014, Paris - Astek ___ es-discuss mailing list es-discuss@mozilla.org https://mail.mozilla.org/listinfo/es-discuss