Closed hyj1991 closed 4 years ago
When the code gets here it should already be a v8::Map
, but maybe we're missing some corner case here. JS_MAP_TYPE
should fall under https://github.com/nodejs/llnode/blob/master/src/printer.cc#L655. Did you hit an issue with it? If so, can you share a small snippet with a reproducible (or more info)?
(JS_MAP_TYPE
is https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Map, right? If so, it's probably worth having a class dedicated for it)
@mmarchini Thanks for your reply :)
When the code gets here it should already be a v8::Map, but maybe we're missing some corner case here. JS_MAP_TYPE should fall under https://github.com/nodejs/llnode/blob/master/src/printer.cc#L655.
Indeed so. But if it already is a v8::Map, why should we judge here whether it is a js object map
: https://github.com/nodejs/llnode/blob/master/src/printer.cc#L478
inline bool Map::IsJSObjectMap(Error& err) {
return InstanceType(err) >= v8()->types()->kFirstJSObjectType;
}
kFirstJSObjectType
is v8dbg_type_JSGlobalObject__JS_GLOBAL_OBJECT_TYPE
(in reality JS_GLOBAL_OBJECT_TYPE
), and I see JS_MAP_TYPE
(src/objects/instance-type.h) is larger than JS_GLOBAL_OBJECT_TYPE
, that's why I confused here.
(JS_MAP_TYPE is https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Map, right? If so, it's probably worth having a class dedicated for it)
Indeed so.
I'll have to take a closer look to answer your questions (I'm going on vacation today, so I'll try to answer it when I'm back around late-Feb)
Thanks a lot :)
If the map here is
JS_MAP_TYPE
, I think maybe theinstance_size
should be: