On Jul 4, 5:35 pm, "ec.developer" <[email protected]> wrote:
> Hi all,
> I'm trying to store a class object in a session (I actually use ExpressJS).
> For class properties everything is fine, but class methods are missed, when
> I access the object.

My guess (without researching) is that the object is being serialized
JSON, which does not allow for functions.

If my guess is correct, you'd have to convert functions to strings
during the serialization process (JSON.stringify accepts a callback as
a second argument where you can do this easily) and know to
deserialize those particular property values as functions instead of
ordinary strings.

-- 
Job Board: http://jobs.nodejs.org/
Posting guidelines: 
https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines
You received this message because you are subscribed to the Google
Groups "nodejs" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/nodejs?hl=en?hl=en

Reply via email to