>
> ```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(thi
That breaks membranes.
From: Gary Guo<mailto:nbdd0...@hotmail.com>
Sent: 2014-12-21 20:00
To: Domenic Denicola<mailto:d...@domenic.me>
Cc: es-discuss@mozilla.org<mailto:es-discuss@mozilla.org>
Subject: RE: Proposal About Private Symbol
I di
e 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
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(
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 ret=fu
> 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
> 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
On Sat, Dec 20, 2014 at 10:41 PM, Gary Guo 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 to
> distinguish
Error('Invalid This');
this[sym]=1;
}
return ret.bind(undefined);
}();
```
> From: nbdd0...@hotmail.com
> To: es-discuss@mozilla.org
> Subject: RE: Proposal About Private Symbol
> Date: Sun, 21 Dec 2014 12:08:09 +0800
>
>
('id')]!=identifier)throw Error('Invalid This');
this[sym]=1;
}
return ret.bind(undefined);
}();
```
________
> Date: Sat, 20 Dec 2014 22:48:37 -0500
> Subject: Re: Proposal About Private Symbol
> From: zenpars...@gmail.com
&
>
> >2. They would not invoke any traps on proxies.
> >3. They would not tunnel through proxies to proxy targets.
> >4. Getting a private-symbol-keyed property would not traverse the
> prototype chain of the object (perhaps arguable).
> Unnecessary, as long as symbol doesn't leak to external enviro
>
>
> Under careful use of the symbols, and without Object.getOwnPropertySymbols
> leaking every symbol, we can use symbols as private field.
>
There are other ways that symbols can leak besides
`getOwnPropertySymbols`. Take a look at proxies, which allow you to
intercept [[Get]] and [[Set]].
In
onstraints I did not
see any problems there.
>From: d...@domenic.me
>To: nbdd0...@hotmail.com; es-discuss@mozilla.org
>Subject: RE: Proposal About Private Symbol
>Date: Sun, 21 Dec 2014 02:58:15 +
>
>Did you read the linked post? The problem is completely differe
zilla.org>
Subject: RE: Proposal About Private Symbol
Oops, seems Outlook.com ruins my email. One more time
I don't think it's a problem though. As long as the private Symbol doesn't
leak, there is no way to access private properties. Private Symbol as I
supposed
e Symbol (just one more boolean field when
defining the struct symbol) though it is not exposed to Script-side.
> From: d...@domenic.me
> To: waldron.r...@gmail.com; nbdd0...@hotmail.com; es-discuss@mozilla.org
> Subject: RE: Proposal About Priva
defining the
struct symbol) though it is not exposed to
Script-side.> 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
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-d
On Sat Dec 20 2014 at 7:54:19 AM Gary Guo wrote:
> I have just sent this proposal through
> http://www.ecma-international.org/memento/register_TC39_Royalty_Free_Task_Group.php
> but
> I don't know what more I need to do. I am a high school student from China
> who is interested in next-generatio
18 matches
Mail list logo