Skip to content
This repository was archived by the owner on Jul 5, 2025. It is now read-only.
This repository was archived by the owner on Jul 5, 2025. It is now read-only.

page.onCallback() does not handle dates #52

Open
@sdesalas

Description

@sdesalas

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions