chromium/third_party/blink/web_tests/fast/dom/HTMLElement/class-list-gc.html

<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN">
<html>
<head>
<script src="../../../resources/js-test.js"></script>
<script src="../../../resources/gc.js"></script>
</head>
<body>
<script>
description('This tests that properties on the classList persists GC.');

var d = document.createElement('div');

// Ensure the classList is created.
var classList = d.classList;

// Set a custom property.
d.classList.life = 42;
shouldEvaluateTo('d.classList.life', 42);

// Null out reference to the dataset.
classList = null;

gc();

// Test that the classList wrapper persisted the GC and still has the custom property.
shouldEvaluateTo('d.classList.life', 42);
</script>
</body>
</html>