dwr.engine._searializeAll using instanceof fails to recognize a Date as a Date when it is comes from another context (frame). The problem was documented in bug # 135, and resolved in 2.0 rc5.
The latest stable 2.0 version has a fix for Array, but not for Date. Can someone please tell me if there is a newer version available with a fix for Date objects.
The issue is documented here:
There is still use of instanceof in _serializeAll, should be exchanged for context-agnotic tests instead:
if (data instanceof String) batch.map[name] = "String:" + encodeURIComponent(data);
else if (data instanceof Boolean) batch.map[name] = "Boolean:" + data;
else if (data instanceof Number) batch.map[name] = "Number:" + data;
else if (data instanceof Date) batch.map[name] = "Date:" + data.getTime();
I think this issue was solved from my latest checkin on the multiple frames problem?
I believe the patch from Mike was applied to util.js, but not for the engine.
I'm attaching a patch for date handling in engine.js. It resolves the context frame issue, but we couldn't find an equivalent solution for Boolean (anyone has an idea ?).
The patch was done against tag 2.0.5 (revision 2079)
Actually the fix I am mentioning in my comment on July 11 has already fixed the problem in engine.js, though the fix was checked in after 2.0.5 was released.
So there is not yet any released version with the fix. I will close this bug report pointing at 2.0.6 for clarity.