Debian Codegraph @

js/src/jit-test/tests/saved-stacks/generators.js

raw
1 // Test that we can save stacks which have generator frames.
2
3 const { value: frame } = (function iife1() {
4 return (function* generator() {
5 yield (function iife2() {
6 return saveStack();
7 }());
8 }()).next();
9 }());
10
11 // Bug 1102498 - toString does not include self-hosted frames, which can appear
12 // depending on GC timing. This may end up changing in the future, see
13 // bug 1103155.
14
15 var lines = frame.toString().split("\n");
16 assertEq(lines[0].startsWith("iife2@"), true);
17 assertEq(lines[1].startsWith("generator@"), true);
18 assertEq(lines[2].startsWith("iife1@"), true);
19 assertEq(lines[3].startsWith("@"), true);