Account Options

  1. Sign in
The old Google Groups will be going away soon, but your browser is incompatible with the new version.
Google Groups Home
« Groups Home
Message from discussion Feature Request: Managed Objects

Received: by 10.224.11.68 with SMTP id s4mr141939qas.18.1292611074498;
        Fri, 17 Dec 2010 10:37:54 -0800 (PST)
X-BeenThere: nodejs@googlegroups.com
Received: by 10.224.3.230 with SMTP id 38ls724846qao.0.p; Fri, 17 Dec 2010
 10:37:49 -0800 (PST)
MIME-Version: 1.0
Received: by 10.224.73.137 with SMTP id q9mr47023qaj.39.1292611069437; Fri, 17
 Dec 2010 10:37:49 -0800 (PST)
Received: by q18g2000vbm.googlegroups.com with HTTP; Fri, 17 Dec 2010 10:37:49
 -0800 (PST)
Date: Fri, 17 Dec 2010 10:37:49 -0800 (PST)
In-Reply-To: <b593565f-f3ae-4202-aaec-24a536a03a6c@l24g2000vby.googlegroups.com>
X-IP: 84.109.234.81
References: <b593565f-f3ae-4202-aaec-24a536a03a6c@l24g2000vby.googlegroups.com>
User-Agent: G2/1.0
X-HTTP-UserAgent: Mozilla/5.0 (Windows; U; Windows NT 6.0; en-US)
 AppleWebKit/534.13 (KHTML, like Gecko) Chrome/9.0.597.19 Safari/534.13,gzip(gfe)
Message-ID: <922cbe6c-e951-4307-8a38-168e688de521@q18g2000vbm.googlegroups.com>
Subject: Re: Feature Request: Managed Objects
From: Shimon Doodkin <helpmep...@gmail.com>
To: nodejs <nodejs@googlegroups.com>
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable

http://ejohn.org/blog/javascript-getters-and-setters/

On Dec 17, 5:39=A0pm, ollym <oliver.mor...@kohark.com> wrote:
> Would it be possible to add something like this:
> It would obviously need some C++ implementation, but would be useful
> for clever OEM/datastore implementations.
>
> var ManagedObject =3D require('util').ManagedObject;
>
> var obj =3D new ManagedObject({
> =A0 =A0get: function(key) { console.log('GET: ' + key); return true; }
> =A0 =A0set: function(key, value) { console.log('SET: ' + key + '=3D' +
> value }
>
> });
>
> obj.value; // returns true
> // Output:
> // GET: value
>
> obj.value =3D false;
> // Output:
> // SET: value=3Dfalse
>
> obj.value; // returns true (still)
> // Output: