We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent c46b2b9 commit 858d4ddCopy full SHA for 858d4dd
test/fixtures/console/stack_overflow.js
@@ -26,10 +26,16 @@ Error.stackTraceLimit = 0;
26
27
console.error('before');
28
29
+// Invalidate elements protector to force slow-path.
30
+// The fast-path of JSON.stringify is iterative and won't throw.
31
+Array.prototype[2] = 'foo';
32
+
33
// Trigger stack overflow by stringifying a deeply nested array.
-let array = [];
-for (let i = 0; i < 100000; i++) {
- array = [ array ];
34
+const depth = 10000;
35
+// eslint-disable-next-line no-sparse-arrays
36
+let array = [,];
37
+for (let i = 0; i < depth; i++) {
38
+ array = [array];
39
}
40
41
JSON.stringify(array);
0 commit comments