1
0
mirror of https://github.com/gryf/pentadactyl-pm.git synced 2026-01-06 20:34:11 +01:00

Fix base.jsm:deprecated with null filenames. Closes issue #261.

This commit is contained in:
Kris Maglione
2011-01-11 12:04:00 -05:00
parent 819fef5834
commit 31d846c0f3

View File

@@ -272,10 +272,10 @@ function deprecated(reason, fn) {
let obj = this.className ? this.className + "#" :
this.constructor.className ? this.constructor.className + "#" :
"";
let filename = frame.filename.replace(/.* -> /, "");
let filename = (frame.filename || "unknown").replace(/.* -> /, "");
if (!set.add(deprecatedMethod.seen, filename))
util.dactyl(fn).echoerr(
util.urlPath(filename || "unknown") + ":" + frame.lineNumber + ": " +
util.urlPath(filename) + ":" + frame.lineNumber + ": " +
obj + (fn.name || name) + " is deprecated: " + reason);
return func.apply(this, arguments);
}