michael@0: // Test that we can save stacks with self-hosted function frames in them. michael@0: michael@0: const map = (function () { michael@0: return [3].map(n => saveStack()).pop(); michael@0: }()); michael@0: michael@0: assertEq(map.parent.functionDisplayName, "map"); michael@0: assertEq(map.parent.source, "self-hosted"); michael@0: michael@0: const reduce = (function () { michael@0: return [3].reduce(() => saveStack(), 3); michael@0: }()); michael@0: michael@0: assertEq(reduce.parent.functionDisplayName, "reduce"); michael@0: assertEq(reduce.parent.source, "self-hosted"); michael@0: michael@0: const forEach = (function () { michael@0: try { michael@0: [3].forEach(n => { throw saveStack() }); michael@0: } catch (s) { michael@0: return s; michael@0: } michael@0: }()); michael@0: michael@0: assertEq(forEach.parent.functionDisplayName, "forEach"); michael@0: assertEq(forEach.parent.source, "self-hosted");