| if (platformSupportsSamplingProfiler()) { |
| load("./sampling-profiler/samplingProfiler.js"); |
| for (let i = 0; i < 500; i++) |
| foo.displayName = "display foo"; |
| runTest(foo, ["display foo"]); |
| for (let i = 0; i < 500; i++) |
| Object.defineProperty(baz, 'displayName', { get: function() { throw new Error("shouldnt be called"); } }); // We should ignore this because it's a getter. |
| for (let i = 0; i < 500; i++) |
| bar.displayName = 20; // We should ignore this because it's not a string. |
| for (let i = 0; i < 500; i++) |
| jaz.displayName = ""; // We should ignore this because it's the empty string. |
| function makeFunction(displayName) { |
| let result = function() { |
| for (let i = 0; i < 500; i++) |
| result.displayName = displayName; |
| runTest(makeFunction("hello world"), ["hello world"]) |