Skip to content

Commit 3d89cd4

Browse files
committed
Use a more thorough check when exporting.
If an element with ID of `module` is in the document, `module.exports` could be defined wrongly. This adds a check to ensure `module.exports` exists first. This commit also removes the `exports` branch which wasn't doing anything, and also is only used in old environments without `module.exports` support, such as Narwhal and older versions of Ringo, which are no longer in use.
1 parent d899797 commit 3d89cd4

File tree

1 file changed

+1
-4
lines changed

1 file changed

+1
-4
lines changed

template/_footer.js

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,12 +8,9 @@ if (typeof define === 'function' && define.amd) {
88
define('raven', [], function() {
99
return Raven;
1010
});
11-
} else if (typeof module === 'object') {
11+
} else if (typeof module === 'object' && module.exports) {
1212
// browserify
1313
module.exports = Raven;
14-
} else if (typeof exports === 'object') {
15-
// CommonJS
16-
exports = Raven;
1714
}
1815

1916
})(typeof window !== 'undefined' ? window : this);

0 commit comments

Comments
 (0)