Skip to content

Commit 2f1f6a0

Browse files
authoredMay 10, 2017
debug fix
This fixes #117 `this._loading` is undefined/null if calling 'define()' directly, rather than via `load()`. `exts` incorrectly being used in `this.types[exts]`. Since exts is an array, it only works if the array holds a single value.
1 parent 9515cda commit 2f1f6a0

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed
 

‎mime.js

+3-3
Original file line numberDiff line numberDiff line change
@@ -22,9 +22,9 @@ Mime.prototype.define = function (map) {
2222
for (var type in map) {
2323
var exts = map[type];
2424
for (var i = 0; i < exts.length; i++) {
25-
if (process.env.DEBUG_MIME && this.types[exts]) {
26-
console.warn(this._loading.replace(/.*\//, ''), 'changes "' + exts[i] + '" extension type from ' +
27-
this.types[exts] + ' to ' + type);
25+
if (process.env.DEBUG_MIME && this.types[exts[i]]) {
26+
console.warn((this._loading || "define()").replace(/.*\//, ''), 'changes "' + exts[i] + '" extension type from ' +
27+
this.types[exts[i]] + ' to ' + type);
2828
}
2929

3030
this.types[exts[i]] = type;

0 commit comments

Comments
 (0)
Please sign in to comment.