Last active
September 17, 2016 00:28
-
-
Save vdanchenkov/4b4964e03a02c2d7a7dd434314bf538b to your computer and use it in GitHub Desktop.
Chrome Canary eats your stack due to tail call optimization http://www.2ality.com/2015/06/tail-call-optimization.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(function () { | |
"use strict" | |
const a = () => '' + b() | |
const b = () => c() | |
const c = () => d() | |
const d = () => new Error().stack | |
console.log(a()) | |
})() | |
/* | |
Error | |
at d (<anonymous>:7:17) | |
at a (<anonymous>:4:22) | |
at <anonymous>:9:13 | |
at <anonymous>:10:3 | |
*/ |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment