ekibun / flutter_qjs

A quickjs engine for flutter.
https://pub.dev/packages/flutter_qjs
MIT License
146 stars 28 forks source link

`Date` is returned as an empty `Map` to Dart #44

Open Matthiee opened 4 months ago

Matthiee commented 4 months ago

Given the following script:

final result = qjs.eval('new Date()');

// result = Map (0 items)

It should be (un)marshalled using the https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/getTime

quickjs-emscripten-sync does it as follows:

https://github.com/reearth/quickjs-emscripten-sync/blob/5936622195290bf051d0aa691012e0f443aebf33/src/unmarshal/custom.ts#L25-L29