MCPcopy
hub / github.com/jvilk/BrowserFS / jsStackTrace

Function jsStackTrace

test/tests/emscripten/bad_lookup.js:1160–1175  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

1158}
1159
1160function jsStackTrace() {
1161 var err = new Error();
1162 if (!err.stack) {
1163 // IE10+ special cases: It does have callstack info, but it is only populated if an Error object is thrown,
1164 // so try that as a special-case.
1165 try {
1166 throw new Error(0);
1167 } catch(e) {
1168 err = e;
1169 }
1170 if (!err.stack) {
1171 return '(no stack trace available)';
1172 }
1173 }
1174 return err.stack.toString();
1175}
1176
1177function stackTrace() {
1178 return demangleAll(jsStackTrace());

Callers 1

stackTraceFunction · 0.70

Calls 1

toStringMethod · 0.80

Tested by

no test coverage detected