Re: What's siteObj in GetTemplateObject?

2014-12-21 Thread Allen Wirfs-Brock
YesOn Dec 21, 2014 10:16 PM, Glen Huang  wrote:
>
> In 12.2.8.2.2, step 16 is `Return siteObj.`, which is never defined. Should 
> it be `Return template.`?
___
es-discuss mailing list
es-discuss@mozilla.org
https://mail.mozilla.org/listinfo/es-discuss


What's siteObj in GetTemplateObject?

2014-12-21 Thread Glen Huang
In 12.2.8.2.2 
,
 step 16 is `Return siteObj.`, which is never defined. Should it be `Return 
template.`?___
es-discuss mailing list
es-discuss@mozilla.org
https://mail.mozilla.org/listinfo/es-discuss


Re: Any news about the `` element?

2014-12-21 Thread Isiah Meadows
Awesome.
On Dec 21, 2014 8:14 PM, "Caridy Patino"  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  wrote:
>
> 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/
>
> ___
> es-discuss mailing list
> es-discuss@mozilla.org
> https://mail.mozilla.org/listinfo/es-discuss
>
>
___
es-discuss mailing list
es-discuss@mozilla.org
https://mail.mozilla.org/listinfo/es-discuss


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);
> }
> ret.prototype.set=function(sth){
> if(!allObject.has(this))throw Error('Invalid Call');
> this[privateSymbol]=sth; // Now this can be called safely, no more
> worry about leak to Proxy
> }
> ret.bind(undefined);
> }
> ```
>

One of the goals of any "object-private state" proposal has to be:

- It should be easy to create private-state-carrying abstractions which are
"safe",
- It should be easy to validate such abstractions as "safe".

I think the code above is a great illustration of how private symbols fail
to satisfy these goals.
___
es-discuss mailing list
es-discuss@mozilla.org
https://mail.mozilla.org/listinfo/es-discuss


Re: Any news about the `` 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  wrote:
> 
> 
>> 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 everything including very simple inline scripts that 
> block rendering.  Also, it's a fairly easy parse to determine whether a 
> script source contains an import statement or not.
> 
> Allen
> 
___
es-discuss mailing list
es-discuss@mozilla.org
https://mail.mozilla.org/listinfo/es-discuss


Re: Any news about the `` 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  wrote:
> 
> 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/
> 
> ___
> es-discuss mailing list
> es-discuss@mozilla.org
> https://mail.mozilla.org/listinfo/es-discuss
___
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 Guo
Sent: ‎2014-‎12-‎21 20:00
To: Domenic Denicola
Cc: es-discuss@mozilla.org
Subject: RE: Proposal About Private Symbol

I didn't quite get the point when private symbols pass through the proxy. What 
will cause the problem in such a situation? How about the proxy get/set the 
target without passing through handler?

For example
```js
var psym=Symbol('private', true);
var obj={};
var proxy=new Proxy(obj, {
get:function(){console.log('Capture');},
set:function(){console.log('Capture');}
);
proxy[psym] // without triggering get handler
proxy[psym]='sth' // without triggering set handler
```
Just simply doesn't grant the proxy the right to operate on private symbols


> From: d...@domenic.me
> To: waldron.r...@gmail.com; nbdd0...@hotmail.com; es-discuss@mozilla.org
> Subject: RE: Proposal About Private Symbol
> Date: Sat, 20 Dec 2014 20:11:04 +
>
> For more reasons on why a simple "private symbol" approach does not quite 
> work, see 
> https://github.com/zenparsing/es-abstract-refs/issues/11#issuecomment-65723350
>
___
es-discuss mailing list
es-discuss@mozilla.org
https://mail.mozilla.org/listinfo/es-discuss


RE: Proposal About Private Symbol

2014-12-21 Thread Gary Guo



I didn't quite get the point when private symbols pass through the proxy. What 
will cause the problem in such a situation? How about the proxy get/set the 
target without passing through handler?
For example```jsvar psym=Symbol('private', true);var obj={};var proxy=new 
Proxy(obj, {get:function(){console.log('Capture');},
set:function(){console.log('Capture');});proxy[psym] // without triggering get 
handlerproxy[psym]='sth' // without triggering set handler```Just simply 
doesn't grant the proxy the right to operate on private symbols

> From: d...@domenic.me
> To: waldron.r...@gmail.com; nbdd0...@hotmail.com; es-discuss@mozilla.org
> Subject: RE: Proposal About Private Symbol
> Date: Sat, 20 Dec 2014 20:11:04 +
> 
> For more reasons on why a simple "private symbol" approach does not quite 
> work, see 
> https://github.com/zenparsing/es-abstract-refs/issues/11#issuecomment-65723350
> 

  ___
es-discuss mailing list
es-discuss@mozilla.org
https://mail.mozilla.org/listinfo/es-discuss


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: Any news about the `` 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/
___
es-discuss mailing list
es-discuss@mozilla.org
https://mail.mozilla.org/listinfo/es-discuss


Re: Any news about the `` 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 everything including very simple inline scripts that block rendering.  
Also, it's a fairly easy parse to determine whether a script source contains an 
import statement or not.

Allen

___
es-discuss mailing list
es-discuss@mozilla.org
https://mail.mozilla.org/listinfo/es-discuss


Re: Any news about the `` 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  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 so they
> could later be upgraded to be module compatible without requiring some
> new out-of-band switch. It hasn't really gotten much traction
> unfortunately.

Wait a minute.  "Strict mode" is not a runtime mode it is a lexical 
characteristic of a JS source file (or the source code of a function).  You can 
this take an arbitrary JS file an say its  going to be run in "strict mode".

You could say that the source code for a Service Worker must be a Module (which 
implies that it is strict mode) even in import and export statements aren't yet 
support.   But this would be a bit more work for implementations as it means 
that top-level module semantics (top level declarations are module local) would 
have to be implemented.

Allen
___
es-discuss mailing list
es-discuss@mozilla.org
https://mail.mozilla.org/listinfo/es-discuss


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 :

> Thank you both.
> Looking forward to the feedback.
>
> On Fri, Dec 19, 2014 at 6:55 PM, Rick Waldron 
> wrote:
>
>> Done: https://github.com/tc39/agendas/blob/master/2015/01.md
>>
>> On Fri Dec 19 2014 at 12:26:33 PM Jason Orendorff <
>> jason.orendo...@gmail.com> wrote:
>>
>>> Having said that, I do think Reflect.isCallable and isConstructor
>>> would be a fine addition to ES7. These places where we check if an
>>> internal method exists feel like a sort of secret-handshake part of
>>> the MOP; we should expose them.
>>>
>>> Any objections?
>>>
>>> Would someone please add it to the agenda for the next meeting?
>>>
>>> -j
>>> ___
>>> es-discuss mailing list
>>> es-discuss@mozilla.org
>>> https://mail.mozilla.org/listinfo/es-discuss
>>>
>>
>
> ___
> es-discuss mailing list
> es-discuss@mozilla.org
> https://mail.mozilla.org/listinfo/es-discuss
>
>
___
es-discuss mailing list
es-discuss@mozilla.org
https://mail.mozilla.org/listinfo/es-discuss


Re: Any news about the `` element?

2014-12-21 Thread Anne van Kesteren
On Sun, Dec 21, 2014 at 5:42 PM, James Burke  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 so they
could later be upgraded to be module compatible without requiring some
new out-of-band switch. It hasn't really gotten much traction
unfortunately.


-- 
https://annevankesteren.nl/
___
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
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
Subject: RE: Proposal About Private Symbol

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.

```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);
}
ret.prototype.set=function(sth){
if(!allObject.has(this))throw Error('Invalid Call');
this[privateSymbol]=sth; // Now this can be called safely, no more 
worry about leak to Proxy
}
ret.bind(undefined);
}
```

On Sun, 21 Dec 2014 12:30:46 +0100, Michal Wadas 
mailto:michalwa...@gmail.com>> wrote:
>> 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 a 
>> object is faked or valid.
>ES6 WeakSet provides you O(1) object check and don't cause memory leak.
___
es-discuss mailing list
es-discuss@mozilla.org
https://mail.mozilla.org/listinfo/es-discuss


Re: Any news about the `` element?

2014-12-21 Thread John Barton
Couldn't the  tag be restricted to be the last tag inside ?
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 at 3:59 PM, Allen Wirfs-Brock 
wrote:

>
> On Dec 20, 2014, at 2:02 PM, Caridy Patino wrote:
>
> John, think of .
>
> For , async is implicit.
>
>
> What if you have a series of modules that need to be evaluated in
> sequential order?  (Remember, that a module with no imports is the module
> worlds  equivalent to a simple  sequential script.).  eg:
>
>