Hey,

On Sat, Nov 15, 2008 at 8:18 PM, kangax <[EMAIL PROTECTED]> wrote:
>
> On Nov 15, 7:36 am, Malte <[EMAIL PROTECTED]> wrote:
>> Joose provides a Role called Joose.Storage that makes Joose objects
>> storable. The preferred method is JSON and a custom  toJSON method is
>> provided to make serialization with json2.js automatic. However, when
>> used in conjunction with Prototype.js the resulting objects seems to
>> be encoded again (More info: In effect the problem only occurs if the
>> Joose objects is located with regular JS objects).
>
> Could you explain what "located with regular JS objects" means? It
> would also be helpful to see a stripped down version of this bug  -
> the test suite doesn't provide any pointers as to what/where went
> wrong (or at least I can't find any).

In the sentence above, I meant "within", like if you serialize
{
    foo: [jooseObject]
}

serializing the jooseObject by itself works. This seems to be due to a
toJSON method that is injected into the Array prototype by
Prototype.js. Can this be true.

The source code of the test is located at
http://code.google.com/p/joose-js/source/browse/trunk/tests/12_storage.t.js
Interestingly the statement at line 49 succeeds. (It stringifies a
Joose object to JSON and and deserializes it again)
The statement on line 81, howevery, fails to produce correct JSON. The
produced string looks like this:
{"test":"[[object Object]]","another":{"a":1}

When you set a firebug break point in Storage.js line 11 you can see
that the code goes deeply into Prototype.js territory.

Bye
Malte

>> We would really like to get Joose to pass all tests when run with
>> Prototype. Could somebody give us a hint about what is going wrong?
>>
>> You can run the test individually and see the problem right 
>> here:http://joose-js.googlecode.com/svn/trunk/tests/test.html#test=12_stor...
>>
>> Thank You,
>>
>> Malte
>
> --
> kangax
> >
>

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Prototype: Core" group.
To post to this group, send email to prototype-core@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/prototype-core?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to