On Tue, Sep 8, 2015 at 1:57 PM, Michael McGlothlin <
[email protected]> 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( 'Symbol.identity' );
> const identity = Symbol( 'identity' );
> var OBJECT_ID = 0;
> Object.defineProperty( Object.prototype, Symbol.identity, {
> get: () => {
> if ( !Object.hasOwnProperty.call( this, identity ) ) {
> this[ identity ] = ++OBJECT_ID;
>
Does not work on frozen objects.
> }
> return this[ identity ];
> }
> } );
>
> On Tue, Sep 8, 2015 at 1:44 PM, Mark S. Miller <[email protected]> wrote:
>
>> See Labeler at
>> http://wiki.ecmascript.org/doku.php?id=harmony:weak_maps#unique_labeler
>>
>>
>>
--
Cheers,
--MarkM
_______________________________________________
es-discuss mailing list
[email protected]
https://mail.mozilla.org/listinfo/es-discuss