Skip to content
This repository has been archived by the owner on Sep 6, 2021. It is now read-only.

Shim Error.prototype.stack for browsers that lack it. #11124

Merged
merged 1 commit into from
May 21, 2015
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions src/utils/Compatibility.js
Original file line number Diff line number Diff line change
Expand Up @@ -39,4 +39,10 @@ define(function () {
String.prototype.trimLeft = function () { return this.replace(/^\s+/, ""); };
}

// Feature detection for Error.stack. Not all browsers expose it
// and Brackets assumes it will be a non-null string.
if (typeof (new Error()).stack === "undefined") {
Error.prototype.stack = "";
}

});