There is no simple way. The object itself does not know that it has been assigned to the variable "a". Also, semantics here seems fuzzy:
var a = "test"; var b = a; What's the name? However, you could figure out some of this if you collect a heap snapshot and see what the retaining paths of that object are. Yang On Mon, Oct 26, 2020 at 12:04 PM L TY <[email protected]> wrote: > Hello, > > I need to get the variable name of an object name in c++ level. > For example > ``` > var a = "test"; > ``` > I need to get the string "a" from the internal Handle<Object> > representation of `a`. > > Anyone has idea how to do it? > > -- > -- > v8-dev mailing list > [email protected] > http://groups.google.com/group/v8-dev > --- > You received this message because you are subscribed to the Google Groups > "v8-dev" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to [email protected]. > To view this discussion on the web visit > https://groups.google.com/d/msgid/v8-dev/cbb4c7c5-e2a6-4880-ac77-694db70fa6f9n%40googlegroups.com > <https://groups.google.com/d/msgid/v8-dev/cbb4c7c5-e2a6-4880-ac77-694db70fa6f9n%40googlegroups.com?utm_medium=email&utm_source=footer> > . > -- -- v8-dev mailing list [email protected] http://groups.google.com/group/v8-dev --- You received this message because you are subscribed to the Google Groups "v8-dev" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To view this discussion on the web visit https://groups.google.com/d/msgid/v8-dev/CAFSTc_jezPHzknh%3DXC1hGPHAMkXXZPpnmZ1cRCo9dTNMDx%3DFhg%40mail.gmail.com.
