| OLD | NEW |
| (Empty) |
| 1 description("This tests that custom properties on element.dataset persist GC."); | |
| 2 | |
| 3 function gc() | |
| 4 { | |
| 5 if (window.GCController) | |
| 6 return GCController.collect(); | |
| 7 | |
| 8 for (var i = 0; i < 10000; i++) { | |
| 9 var s = new String(""); | |
| 10 } | |
| 11 } | |
| 12 | |
| 13 | |
| 14 var d = document.createElement("div"); | |
| 15 | |
| 16 var dataset = d.dataset; | |
| 17 // Add a property to our prototype. It will be hidden by the corresponding data-
attribute. | |
| 18 dataset.__proto__.customProperty = 1; | |
| 19 dataset.customProperty = 1; // Now set a property on ourselves. | |
| 20 shouldBe("d.getAttribute('data-custom-property')", "'1'"); | |
| 21 shouldBe("d.dataset.customProperty", "'1'"); | |
| 22 | |
| 23 dataset = null; | |
| 24 | |
| 25 gc(); | |
| 26 | |
| 27 // Test that the custom property persisted the GC. | |
| 28 shouldBe("d.dataset.customProperty", "'1'"); | |
| OLD | NEW |