mirror of
				https://github.com/RGBCube/serenity
				synced 2025-10-31 03:02:45 +00:00 
			
		
		
		
	 719a00df3a
			
		
	
	
		719a00df3a
		
	
	
	
	
		
			
			With this change JS::Handle root nodes will contain source location
where they were constructed like:
```
    "94675029575744": {
        "root": "Handle activate_event_handler \
           serenity/Userland/Libraries/LibWeb/DOM/EventTarget.cpp:564",
        "class_name": "HTMLButtonElement",
        "edges": [
            "94675025955904",
            "94675026899520",
            "94675030831168",
```
		
	
			
		
			
				
	
	
		
			25 lines
		
	
	
	
		
			462 B
		
	
	
	
		
			C++
		
	
	
	
	
	
			
		
		
	
	
			25 lines
		
	
	
	
		
			462 B
		
	
	
	
		
			C++
		
	
	
	
	
	
| /*
 | |
|  * Copyright (c) 2020, Andreas Kling <kling@serenityos.org>
 | |
|  *
 | |
|  * SPDX-License-Identifier: BSD-2-Clause
 | |
|  */
 | |
| 
 | |
| #include <LibJS/Heap/Cell.h>
 | |
| #include <LibJS/Heap/Handle.h>
 | |
| #include <LibJS/Runtime/VM.h>
 | |
| 
 | |
| namespace JS {
 | |
| 
 | |
| HandleImpl::HandleImpl(Cell* cell, SourceLocation location)
 | |
|     : m_cell(cell)
 | |
|     , m_location(location)
 | |
| {
 | |
|     m_cell->heap().did_create_handle({}, *this);
 | |
| }
 | |
| 
 | |
| HandleImpl::~HandleImpl()
 | |
| {
 | |
|     m_cell->heap().did_destroy_handle({}, *this);
 | |
| }
 | |
| 
 | |
| }
 |