How can I rethrow an exception in Javascript, but preserve the stack?

This is a bug in Chrome. Rethrowing an exception should preserve the call trace. http://code.google.com/p/chromium/issues/detail?id=60240 I don’t know of any workaround. I don’t see the problem with finally. I do see exceptions silently not showing up on the error console in some cases after a finally, but that one seems to be fixed in development … Read more

How do you find out the caller function in JavaScript?

Note that this solution is deprecated and should no longer be used according to MDN documentation https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Function/caller function Hello() { alert(“caller is ” + Hello.caller); } Note that this feature is non-standard, from Function.caller: Non-standard This feature is non-standard and is not on a standards track. Do not use it on production sites facing the … Read more