summaryrefslogtreecommitdiffstats
path: root/js/src/jit-test/tests/basic/display-url-in-stack-trace.js
blob: acab47ab61ee52aa9ca078e503469049546ab52f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
eval(`
  function a() {
    return b();
  }
  //# sourceURL=source-a.js
`);

eval(`
  function b() {
    return c();
  }
  //# sourceURL=source-b.js
`);

eval(`
  function c() {
    return Error().stack;
  }
  //# sourceURL=source-c.js
`);

let filenames = a().split(/\n/)
                   .map(f => f.slice(f.indexOf("@") + 1, f.indexOf(":")));
print(filenames.join("\n"));
assertEq(filenames[0], "source-c.js");
assertEq(filenames[1], "source-b.js");
assertEq(filenames[2], "source-a.js");