Re: Module import/export bindings

2015-03-16 Thread caridy
inline On Mar 16, 2015, at 2:21 AM, Glen Huang curvedm...@gmail.com wrote: On second thought, this does seem to imply that polyfills can’t use the module syntax, which means they can’t use utility libraries written in module syntax, and, if you are writing a complex polyfill, managing

Re: Module import/export bindings

2015-03-16 Thread Mark Miller
Story is way too simple. JS const means constant, unchanging. By contrast, import bindings, like const in C++, means read-only view. This is *very* different from constant. Don't use the const analogy when changes are still observable. On Mon, Mar 16, 2015 at 9:20 AM, Allen Wirfs-Brock

Re: Module import/export bindings

2015-03-16 Thread Allen Wirfs-Brock
On Mar 16, 2015, at 9:26 AM, Mark Miller wrote: Story is way too simple. JS const means constant, unchanging. By contrast, import bindings, like const in C++, means read-only view. This is *very* different from constant. Don't use the const analogy when changes are still observable. got

Re: Module import/export bindings

2015-03-16 Thread Allen Wirfs-Brock
On Mar 15, 2015, at 9:43 PM, Domenic Denicola wrote: From: es-discuss [mailto:es-discuss-boun...@mozilla.org] On Behalf Of Kyle Simpson Would it then be appropriate to explain that conceptually the binding would otherwise indeed be 2-way, but that the immutable/read-only nature of the

Re: Reflect.getOwnPropertySymbols?

2015-03-16 Thread Allen Wirfs-Brock
On Mar 15, 2015, at 2:48 PM, Keith Cirkel wrote: It seems like the intention of the Reflect API was to create a standard object were all reflection operations could reside. Now that we have modules, a “@reflect” module is a more natural place for many of the reflection methods previously

Re: What is the difference between `newTarget` and `F` in abstract operation `Construct(..)` ?

2015-03-16 Thread Coolwust
Thanks very much for the explanation! it's clear now. On Mon, Mar 16, 2015 at 1:58 PM, Allen Wirfs-Brock al...@wirfs-brock.com wrote: On Mar 16, 2015, at 10:32 AM, Coolwust wrote: From ES 6, section 7.3.14, there is an abstract operation `Construct (F, [argumentsList], [newTarget])`, so if

What is the difference between `newTarget` and `F` in abstract operation `Construct(..)` ?

2015-03-16 Thread Coolwust
From ES 6, section 7.3.14, there is an abstract operation `Construct (F, [argumentsList], [newTarget])`, so if I have the following code `var foo = new bar()`, then `newTarget` is the same as `F`, which is `bar`. My question is, in what situation, `F` is **NOT** the same as `newTarget`? And what

Re: What is the difference between `newTarget` and `F` in abstract operation `Construct(..)` ?

2015-03-16 Thread Axel Rauschmayer
They diverge if a constructor makes a super-constructor call: The last constructor in a chain of super-constructor calls allocates the instance and it has to use `newTarget.prototype` as the prototype. `newTarget` is first filled in by the `new` operator and later passed on by `super`. This is

Re: Reflect.getOwnPropertySymbols?

2015-03-16 Thread Jason Orendorff
On Mon, Mar 16, 2015 at 11:53 AM, Allen Wirfs-Brock al...@wirfs-brock.com wrote: In ES6, the primary role of the Reflect object is to provide direct access to an object's essential internal methods:

Re: What is the difference between `newTarget` and `F` in abstract operation `Construct(..)` ?

2015-03-16 Thread Allen Wirfs-Brock
On Mar 16, 2015, at 10:32 AM, Coolwust wrote: From ES 6, section 7.3.14, there is an abstract operation `Construct (F, [argumentsList], [newTarget])`, so if I have the following code `var foo = new bar()`, then `newTarget` is the same as `F`, which is `bar`. My question is, in what

String.prototype.trimRight/trimLeft

2015-03-16 Thread Dmitry Soshnikov
Hi, Just got a question why don't we polyfill `trimLeft` and `trimRight` for strings, and have only `trim` (and the answer is -- because it's not part of ES5/ES6). Just thinking could it be a valid cases when a dev may want to trim only form right still keeping e.g. the precalculated padding on

Re: Module import/export bindings

2015-03-16 Thread Glen Huang
On second thought, this does seem to imply that polyfills can’t use the module syntax, which means they can’t use utility libraries written in module syntax, and, if you are writing a complex polyfill, managing dependencies requires ensuring correct script loading order (whether that means