| <!-- |
| Copyright 2024 The Chromium Authors |
| Use of this source code is governed by a BSD-style license that can be |
| found in the LICENSE file. |
| --> |
| <h1>Memory Panel (Heap profiler) Test</h1> |
| <script> |
| var firstRetainer = {x: {y: 'searchable_string'}}; |
| var weakMap = new WeakMap(); |
| class KeyType {} |
| var firstKey = new KeyType(); |
| var secondKey = {p: {q: {}}}; |
| weakMap.set(firstKey, firstRetainer.x); |
| weakMap.set(secondKey.p.q, firstRetainer.x); |
| // Some additional properties are included in the following object so that |
| // this test case can also serve to verify the formatting of plain JS objects. |
| var lastRetainer = { |
| a: { |
| b: { |
| ['#'.repeat(130)]: 2, |
| c: { |
| d: firstRetainer.x |
| } |
| }, |
| irrelevantProperty: 3, |
| [Symbol('also irrelevant')]: 4, |
| '}': 5 |
| } |
| }; |
| for (var i = 0; i < 10; ++i) { |
| lastRetainer['extraProp' + i] = i; |
| } |
| </script> |