On Wed, Jun 17, 2015 at 11:19 AM, Yusuke SUZUKI utatane@gmail.com
wrote:
It turns out the spec is fine
https://people.mozilla.org/~jorendorff/es6-draft.html#sec-weakmap.prototype.set
step 5 says
If Type
On 6/17/15 2:35 PM, Mark S. Miller wrote:
What do other browsers currently do?
Firefox:
var w = new WeakMap(); var r = Symbol.for('foo'); w.set(r, true);
TypeError: r is not a non-null object
WebKit nightly:
var w = new WeakMap(); var r = Symbol.for('foo'); w.set(r, true);
TypeError:
actually I was surprised the apparently mentioned native behavior looked
too much like my Symbol based WeakMap partial poly:
```js
var WeakMap = WeakMap || (function (s) {'use strict';
function WeakMap() {
this[s] = Symbol('WeakMap');
}
WeakMap.prototype = {
'delete': function
It turns out the spec is fine
https://people.mozilla.org/~jorendorff/es6-draft.html#sec-weakmap.prototype.set
step 5 says
If Type
https://people.mozilla.org/~jorendorff/es6-draft.html#sec-ecmascript-data-types-and-values
(*key*) is not Object, throw a *TypeError* exception.
as I hoped
TypeError: Invalid value used as weak map key
Yes, already fixed on v8. Thanks.
On Wed, Jun 17, 2015 at 11:51 AM, Caitlin Potter caitpotte...@gmail.com
wrote:
The v8 bug referred to earlier in this thread was filed by Rick Waldron
and fixed back in March, I think engines are on the same
It would return a different object each time (for the same Symbol, like new
String) so it would not exhibit the problem of being observable.
On Jun 17, 2015, at 20:54, Jordan Harband ljh...@gmail.com wrote:
Could I not use `Object(Symbol.for('some global registry symbol'))` as a
`WeakMap`
On Wed, Jun 17, 2015 at 9:31 AM, Yusuke SUZUKI utatane@gmail.com
wrote:
On Thu, Jun 18, 2015 at 1:18 AM, Mark S. Miller erig...@google.com
wrote:
[+Allen]
Can registered Symbols be used as keys in WeakMaps? If so, we have a
fatal unauthorized communications channel that we need to fix
The v8 bug referred to earlier in this thread was filed by Rick Waldron and
fixed back in March, I think engines are on the same page with this — just FYI
On Jun 17, 2015, at 2:49 PM, Boris Zbarsky bzbar...@mit.edu wrote:
On 6/17/15 2:35 PM, Mark S. Miller wrote:
What do other browsers
uh ... never mind then, I don't even need to understand :D
Cheers
On Wed, Jun 17, 2015 at 7:51 PM, Caitlin Potter caitpotte...@gmail.com
wrote:
The v8 bug referred to earlier in this thread was filed by Rick Waldron
and fixed back in March, I think engines are on the same page with this —
Could I not use `Object(Symbol.for('some global registry symbol'))` as a
`WeakMap` key? That would return a realm-specific object, of course.
On Wed, Jun 17, 2015 at 10:19 AM, Benjamin Gruenbaum ing...@gmail.com
wrote:
congratulations and THANK YOU! I learned something important reading
your
Interning of a particular immutable-objects-with-identity in an interning
table can still safely be weakly interned, by marking that object, at
interning time, so all WeakMaps from then on hold it strongly
Oh cool, I didn't realize that. That is pretty neat :)
On Wed, Jun 17, 2015 at 10:54 PM,
On 6/17/15 1:54 PM, Jordan Harband wrote:
Could I not use `Object(Symbol.for('some global registry symbol'))` as a
`WeakMap` key? That would return a realm-specific object, of course.
Object(Symbol.for(x)) == Object(Symbol.for(x)) tests false. That's
because
The idea that (a shared Weak interning table of
immutable-objects-with-identity + WeakMaps makes gc observable) is not new.
The idea that (the shared interning tables of
immutable-objects-with-identity must therefore be strong) is not new.
What was new to me is the idea that
Interning of a
this is puzzling me too ... so I've got few cases
1. you want/need a one to many relations, Symbol as key, Array as value,
and you play with that Array values as needed per each Symbol used as key
in the very same WeakMap
2. you invert the logic and you have a WeakMap that checks per each
On Jun 17, 2015, at 9:18 AM, Mark S. Miller wrote:
[+Allen]
Can registered Symbols be used as keys in WeakMaps? If so, we have a fatal
unauthorized communications channel that we need to fix in the spec asap!
No, symbols are not objects and the keys of WeakMaps must be objects.
BTW,
congratulations and THANK YOU! I learned something important reading your
messages. The notion that we can preserve non-observability when making one
thing a WeakMap iff we make all other WeakMaps be strong for those same
objects is true, novel, and very surprising. I have been working on
I am curious about what these are? But regardless, I would expect there to
be examples where it would be useful if it weren't fatal. Regarding the
issues in this thread, it actually would be safe to allow unregistered
Symbols as keys. But unless these examples are tremendously compelling,
please
by the WeakMap,
siteObject will be collected.
var siteObject = tag`hello`;
map.get(siteObject); // false, but should be true.
To avoid this situation, we need to specially handle template site
objects in WeakMap; WeakMap refers template site objects strongly (if we
choose the weak reference
Aren't WeakMap keys only objects?
On Jun 17, 2015, at 19:18, Mark S. Miller erig...@google.com wrote:
[+Allen]
Can registered Symbols be used as keys in WeakMaps? If so, we have a fatal
unauthorized communications channel that we need to fix in the spec asap!
On Thu, Jun 18, 2015 at 1:18 AM, Mark S. Miller erig...@google.com wrote:
[+Allen]
Can registered Symbols be used as keys in WeakMaps? If so, we have a fatal
unauthorized communications channel that we need to fix in the spec asap!
Why do registered Symbols appear? (oops, maybe I missed
= tag`hello`;
map.get(siteObject); // false, but should be true.
To avoid this situation, we need to specially handle template site
objects in WeakMap; WeakMap refers template site objects strongly (if we
choose the weak reference implementation for realm.[[templateMap]]).
But this may
[+Allen]
Can registered Symbols be used as keys in WeakMaps? If so, we have a fatal
unauthorized communications channel that we need to fix in the spec asap!
___
es-discuss mailing list
es-discuss@mozilla.org
https://mail.mozilla.org/listinfo/es-discuss
`hello`;
map.get(siteObject); // false, but should be true.
To avoid this situation, we need to specially handle template site
objects in WeakMap; WeakMap refers template site objects strongly (if we
choose the weak reference implementation for realm.[[templateMap]]).
But this may complicate
(); // If realm.[[templateMap]] is implemente by the WeakMap,
siteObject will be collected.
var siteObject = tag`hello`;
map.get(siteObject); // false, but should be true.
To avoid this situation, we need to specially handle template site
objects in WeakMap; WeakMap refers template site objects
the property with it
indirectly by using WeakMap.
As a result, if the site objects are referenced by the realm weakly, users
can observe it by using WeakMap.
To avoid this situation, we need to specially handle template site objects
in WeakMap; WeakMap refers template site objects strongly (if we choose
, if the site objects are referenced by the realm weakly, users
can observe it by using WeakMap.
To avoid this situation, we need to specially handle template site objects
in WeakMap; WeakMap refers template site objects strongly (if we choose the
weak reference implementation for realm.[[templateMap
are referenced by the realm weakly,
users can observe it by using WeakMap.
To avoid this situation, we need to specially handle template site
objects in WeakMap; WeakMap refers template site objects strongly (if we
choose the weak reference implementation for realm.[[templateMap]]).
But this may
with it
indirectly by using WeakMap.
As a result, if the site objects are referenced by the realm weakly, users
can observe it by using WeakMap.
To avoid this situation, we need to specially handle template site objects
in WeakMap; WeakMap refers template site objects strongly (if we choose the
weak
WeakMap.
As a result, if the site objects are referenced by the realm weakly,
users can observe it by using WeakMap.
To avoid this situation, we need to specially handle template site
objects in WeakMap; WeakMap refers template site objects strongly (if we
choose the weak reference
29 matches
Mail list logo