js/src/jit-test/tests/saved-stacks/self-hosted.js

Wed, 31 Dec 2014 06:09:35 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Wed, 31 Dec 2014 06:09:35 +0100
changeset 0
6474c204b198
permissions
-rw-r--r--

Cloned upstream origin tor-browser at tor-browser-31.3.0esr-4.5-1-build1
revision ID fc1c9ff7c1b2defdbc039f12214767608f46423f for hacking purpose.

     1 // Test that we can save stacks with self-hosted function frames in them.
     3 const map = (function () {
     4   return [3].map(n => saveStack()).pop();
     5 }());
     7 assertEq(map.parent.functionDisplayName, "map");
     8 assertEq(map.parent.source, "self-hosted");
    10 const reduce = (function () {
    11   return [3].reduce(() => saveStack(), 3);
    12 }());
    14 assertEq(reduce.parent.functionDisplayName, "reduce");
    15 assertEq(reduce.parent.source, "self-hosted");
    17 const forEach = (function () {
    18   try {
    19     [3].forEach(n => { throw saveStack() });
    20   } catch (s) {
    21     return s;
    22   }
    23 }());
    25 assertEq(forEach.parent.functionDisplayName, "forEach");
    26 assertEq(forEach.parent.source, "self-hosted");

mercurial