Re: Proposal About Private Symbol

2014-12-21 Thread Tab Atkins Jr.
On Sat, Dec 20, 2014 at 10:41 PM, Gary Guo nbdd0...@hotmail.com wrote: Oops, mistakes found. I just ignored the fact that in this particular way the Symbol can be retrieved. It seems impossible to have an idea of private symbol in this way. In the case, I think the language can provide a way

RE: Proposal About Private Symbol

2014-12-21 Thread Gary Guo
From: jackalm...@gmail.com Date: Sun, 21 Dec 2014 00:45:40 -0800 There are ways around this, too - create your own Symbol, keep it closure-private to the class, so it doesn't escape the class's methods. Have the constructor take an extra argument that must be equal to this symbol; if it's

RE: Proposal About Private Symbol

2014-12-21 Thread Michał Wadas
But this is not the core of the problem. The problem is the Proxy introduced in ES6 enables an object to capture and override almost any operation on an object. Without operation on object, it becomes very costly (by using an Array of created objects and compare each of them) to identify whether

RE: Proposal About Private Symbol

2014-12-21 Thread Gary Guo
Oops, I forget the WeakSet. So seems my private symbol proposal can work now. Under very deliberately design, private symbol can be used as private field. ```jsvar constructor=function(){'use strict';var allObjects=new WeakSet();var privateSymbol=Symbol('private', true);var

Re: Any news about the `module` element?

2014-12-21 Thread James Burke
On Fri, Dec 19, 2014 at 8:55 PM, caridy car...@gmail.com wrote: Yeah, the idea is to get engines (V8 maybe) to implement what is spec’d in ES6 today, and get a very basic implementation of script type=module. Remember, the goal is to get this out there asap to start gathering feedback from

Re: Any news about the `module` element?

2014-12-21 Thread John Barton
Couldn't the module tag be restricted to be the last tag inside html? Then we don't need them to be async to avoid blocking rendering and the declarative order would more closely match the semantics. Multiple tags could be loaded in parallel and sequenced on execution. jjb On Sat, Dec 20, 2014

RE: Proposal About Private Symbol

2014-12-21 Thread Domenic Denicola
Yes, if you use weak sets in combination with private symbols you can more or less emulate weak maps. But why not just use weak maps in that case? From: es-discuss [mailto:es-discuss-boun...@mozilla.org] On Behalf Of Gary Guo Sent: Sunday, December 21, 2014 07:26 To: es-discuss@mozilla.org

Re: Any news about the `module` element?

2014-12-21 Thread Anne van Kesteren
On Sun, Dec 21, 2014 at 5:42 PM, James Burke jrbu...@gmail.com wrote: (I am sure you are aware of the coming Service Worker bliss, so not just a curious side issue): I and some others have been advocating for service workers to run in strict mode by default, as well as having this be undefined

Re: Add Reflect.isConstructor and Reflect.isCallable?

2014-12-21 Thread Tom Van Cutsem
Adding Reflect.{isCallable, isConstructor} looks reasonable to me. If the spec needs these internally, chances are JS developers will need them at one point. And as you note, typeof === function is a common work-around in use today. So +1. 2014-12-21 0:20 GMT+01:00 Tom Schuster t...@schuster.me:

Re: Any news about the `module` element?

2014-12-21 Thread Allen Wirfs-Brock
On Dec 21, 2014, at 10:10 AM, Anne van Kesteren wrote: On Sun, Dec 21, 2014 at 5:42 PM, James Burke jrbu...@gmail.com wrote: (I am sure you are aware of the coming Service Worker bliss, so not just a curious side issue): I and some others have been advocating for service workers to run in

Re: Any news about the `module` element?

2014-12-21 Thread Allen Wirfs-Brock
On Dec 20, 2014, at 6:21 PM, Caridy Patino wrote: The problem is that those inline modules might import other modules, e.g.: But because of the improved semantics (implicit strict, file local declaration scope, etc.) we really would like to see a world where people use type=modules for

Re: Any news about the `module` element?

2014-12-21 Thread Isiah Meadows
I found [this][1] a while back, and can't seem to find any discussion or specification more up to date than this document until this thread. I know it could be a little off topic, but just throwing it out there. [1]: https://whatwg.github.io/loader/

RE: Add Reflect.isConstructor and Reflect.isCallable?

2014-12-21 Thread Gary Guo
If added, it can help ES engines to write more code in ES instead of native languages. So +1 as well. ___ es-discuss mailing list es-discuss@mozilla.org https://mail.mozilla.org/listinfo/es-discuss

RE: Proposal About Private Symbol

2014-12-21 Thread Domenic Denicola
That breaks membranes. From: Gary Guomailto:nbdd0...@hotmail.com Sent: ‎2014-‎12-‎21 20:00 To: Domenic Denicolamailto:d...@domenic.me Cc: es-discuss@mozilla.orgmailto:es-discuss@mozilla.org Subject: RE: Proposal About Private Symbol I didn't quite get the point

Re: Any news about the `module` element?

2014-12-21 Thread Caridy Patino
Isiah, yes, we are still trying to get some traction on that repo. we will be adding some docs related to this discussion soon. Sent from my iPhone On Dec 21, 2014, at 6:44 PM, Isiah Meadows impinb...@gmail.com wrote: I found [this][1] a while back, and can't seem to find any discussion or

Re: Any news about the `module` element?

2014-12-21 Thread Caridy Patino
Allen, that's my hope. It will be ideal, and it solves web workers and service workers use cases, but we need implementers to chime in. Sent from my iPhone On Dec 21, 2014, at 5:52 PM, Allen Wirfs-Brock al...@wirfs-brock.com wrote: On Dec 20, 2014, at 6:21 PM, Caridy Patino wrote: The

Re: Proposal About Private Symbol

2014-12-21 Thread Kevin Smith
```js var constructor=function(){ 'use strict'; var allObjects=new WeakSet(); var privateSymbol=Symbol('private', true); var ret=function(){ if(this===undefined)throw Error('Invalid Construction'); this[privateSymbol]=1; allObjects.add(this);

Re: Any news about the `module` element?

2014-12-21 Thread Isiah Meadows
Awesome. On Dec 21, 2014 8:14 PM, Caridy Patino car...@gmail.com wrote: Isiah, yes, we are still trying to get some traction on that repo. we will be adding some docs related to this discussion soon. Sent from my iPhone On Dec 21, 2014, at 6:44 PM, Isiah Meadows impinb...@gmail.com wrote: