1
0
mirror of https://github.com/gryf/pentadactyl-pm.git synced 2026-02-17 10:05:45 +01:00

Try not to break things on :rehash for users running from the repo.

This commit is contained in:
Kris Maglione
2011-01-05 19:37:54 -05:00
parent 3a3f011fc9
commit b1e8834f3b
5 changed files with 31 additions and 22 deletions

View File

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