Re: memory safety and weak references

2015-09-08 Thread Mark Miller
At https://esdiscuss.org/topic/memory-safety-and-weak-references#content-1 Dave Herman wrote > Interestingly, I wonder if the idea of only collecting weak references > between turns is immune to such attacks, since it's not possible to > have a bogus reference on the stack between turns, where

Re: Object id, hash, etc?

2015-09-08 Thread Mark S. Miller
See Labeler at http://wiki.ecmascript.org/doku.php?id=harmony:weak_maps#unique_labeler On Tue, Sep 8, 2015 at 11:16 AM, joe wrote: > Didn't send to list, something is wrong with my reply all. Sorry about > that. Stupid mobile gmail. > -- Forwarded message --

Re: Object id, hash, etc?

2015-09-08 Thread Mark S. Miller
On Tue, Sep 8, 2015 at 1:57 PM, Michael McGlothlin < mike.mcgloth...@gmail.com> wrote: > I try to keep it pretty simple. It's not fancy but the times you want fast > and dirty information like this are the same times you don't want to have > to define it manually. > > Symbol.identity = Symbol(

Re: Object id, hash, etc?

2015-09-08 Thread Tab Atkins Jr.
On Tue, Sep 8, 2015 at 2:07 PM, Mark S. Miller wrote: > On Tue, Sep 8, 2015 at 1:57 PM, Michael McGlothlin > wrote: >> >> I try to keep it pretty simple. It's not fancy but the times you want fast >> and dirty information like this are the same

Re: Object id, hash, etc?

2015-09-08 Thread Mark S. Miller
Hi Tab, then you get the Labeler, which this message is responding to. On Tue, Sep 8, 2015 at 2:12 PM, Tab Atkins Jr. wrote: > On Tue, Sep 8, 2015 at 2:07 PM, Mark S. Miller wrote: > > On Tue, Sep 8, 2015 at 1:57 PM, Michael McGlothlin > >

Re: Object id, hash, etc?

2015-09-08 Thread Andrea Giammarchi
as side note, that's just a lazy assignment that doesn't need two symbols and a constant get invoke ... ```js Symbol.identity = Symbol( 'Symbol.identity' ); var OBJECT_ID = 0; Object.defineProperty( Object.prototype, Symbol.identity, { get: function () { // first time this is

Re: Object id, hash, etc?

2015-09-08 Thread Michael McGlothlin
I try to keep it pretty simple. It's not fancy but the times you want fast and dirty information like this are the same times you don't want to have to define it manually. Symbol.identity = Symbol( 'Symbol.identity' ); const identity = Symbol( 'identity' ); var OBJECT_ID = 0;

RE: Object id, hash, etc?

2015-09-08 Thread Gary Guo
Changing toString() is obviously not possible since the semantics are fixed and many existing code depends them (ex. Object.prototype.toString are used for type identifying, String.prototype.toString are used for meta-programming frameworks. I think you can extend Object.prototype to provide a

Object id, hash, etc?

2015-09-08 Thread Michael McGlothlin
Is there a reason not to provide an object id and hash value as other languages often do? I find myself defining an identity symbol on objects with a value from a simple global counter. It makes it easier to debug if I can just look at a log and see what objects and functions were active.

Re: Object id, hash, etc?

2015-09-08 Thread joe
Didn't send to list, something is wrong with my reply all. Sorry about that. Stupid mobile gmail. -- Forwarded message -- From: "joe" Date: Sep 8, 2015 11:15 AM Subject: Re: Object id, hash, etc? To: "Garrett Smith" Cc: I agree with this