we (web engine): Experimental web browser project to understand the limits of Claude
2
fork

Configure Feed

Select the types of activity you want to include in your feed.

Review fixes: add DOM wrapper cache entries as GC roots

The node_wrappers identity cache in DomBridge holds GcRef values that
were not included in collect_roots(), meaning the GC could collect
wrapper objects and break wrapper identity (same DOM node returning
different JS objects across calls). Add cached wrappers as GC roots
so identity is preserved across garbage collection cycles.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

+7
+7
crates/js/src/vm.rs
··· 1995 1995 if let Some(r) = self.promise_prototype { 1996 1996 roots.push(r); 1997 1997 } 1998 + // DOM wrapper identity cache: keep cached wrappers alive so that the 1999 + // same DOM node always returns the same JS object. 2000 + if let Some(bridge) = &self.dom_bridge { 2001 + for &wrapper_ref in bridge.node_wrappers.borrow().values() { 2002 + roots.push(wrapper_ref); 2003 + } 2004 + } 1998 2005 roots 1999 2006 } 2000 2007