MCPcopy Create free account
hub / github.com/BorisMoore/jquery-tmpl / sourceFromStacktrace

Function sourceFromStacktrace

tests/qunit.js:735–747  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

733// so far supports only Firefox, Chrome and Opera (buggy)
734// could be extended in the future to use something like https://github.com/csnover/TraceKit
735function sourceFromStacktrace() {
736 try {
737 throw new Error();
738 } catch ( e ) {
739 if (e.stacktrace) {
740 // Opera
741 return e.stacktrace.split("\n")[6];
742 } else if (e.stack) {
743 // Firefox, Chrome
744 return e.stack.split("\n")[4];
745 }
746 }
747}
748
749function resultDisplayStyle(passed) {
750 return passed && id("qunit-filter-pass") && id("qunit-filter-pass").checked ? 'none' : '';

Callers 1

qunit.jsFile · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected