Take a std::map<std::string, double>. If you create a javascript map with this pair { "0": 3.1415 }, the conversion from v8 type to C++ map with fail, because the key "0" is store as number 0 in javascript.
In my case, I have this problem because I create a C++ map with a string key (with a just number), return that map in a function bind in javascript, and then retrieve that value inside another function.
I try locally this fix inside convert<String, ...> inside convert.hpp, and it seems to work great:
Take a
std::map<std::string, double>
. If you create a javascript map with this pair{ "0": 3.1415 }
, the conversion from v8 type to C++ map with fail, because the key"0"
is store as number0
in javascript. In my case, I have this problem because I create a C++ map with a string key (with a just number), return that map in a function bind in javascript, and then retrieve that value inside another function.I try locally this fix inside
convert<String, ...>
insideconvert.hpp
, and it seems to work great:In case you prefer/require a Pull requests to fix that bug, I can try to do it with the right unit test.