Skip to content
This repository was archived by the owner on May 15, 2023. It is now read-only.

page.onCallback() does not handle dates #52

Open
sdesalas opened this issue Mar 8, 2015 · 1 comment
Open

page.onCallback() does not handle dates #52

sdesalas opened this issue Mar 8, 2015 · 1 comment
Labels
Milestone

Comments

@sdesalas
Copy link
Owner

sdesalas commented Mar 8, 2015

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.

@sdesalas sdesalas added the bug label Mar 8, 2015
@sdesalas sdesalas added this to the Core API milestone Mar 8, 2015
@sdesalas
Copy link
Owner Author

sdesalas commented Mar 9, 2015

Actually, this could be related to console.log() which turns dates into date strings..

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

1 participant