Is it possible to determine if two objects in the Chrome debugger match?

In Eclipse, the debugger shows a unique session identifier next to each object (for Java and AS3, anyway). This makes it easy to identify the same object that appears in multiple contexts.

I am working on a JavaScript project and would like to have the same ability to identify objects in the Chrome debugger (for example, in the "Variable Areas" area). Is this information tracked by the browser / debugger? Is there any other way to identify an object through contexts without adding code (this is just an IDE method for this, applicable to any context).

+6
source share
3 answers

Technically, this is possible. You probably already see this if you use Chrome Dev Tools for Java (Eclipse-based debugger). http://code.google.com/p/chromedevtools

As for the debugger in the browser, the user interface simply does not have an interface for this. I think you should file a function request at: http://crbug.com

PS Please note that this is not an address at all - both Java and JavaScript move their objects in memory at arbitrary points.

+2
source

I believe this is possible with Chrome Dev Tools:

  • Getting a heap snapshot and opening a console in a summary view
  • Printing an object in the console
  • Right-click on the console output and select "Show in summary view" (if you do not see this option, you probably do not have an open profile panel)
+1
source

JavaScript has no memory addresses. "One and the same variable" can be compared using the triple equality notation ( anObjectReference === anotherObjectReference )

0
source

Source: https://habr.com/ru/post/949584/


All Articles