trifleJS
trifleJS copied to clipboard
page.onCallback() does not handle dates
TrifleJS is using JSON.stringify() to copy objects from IE context to the V8 runtime where test scripts are executed. Thus if you do something like this:
page.onCallback = function(theDate, theType) {
console.log(theDate, theType);
}
page.evaluate(function(date) {
window.callPhantom(date, typeof date);
}, new Date());
You will recieve:
[
"2015-03-08T03:05:10.294Z",
"object"
]
Meaning that IE gets an object, but sends back a ISO date string.
Please investigate actual behaviour in PhantomJS and add some unit tests.
Actually, this could be related to console.log() which turns dates into date strings..