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

Deprecate :let and dactyl.globalVariables.

This commit is contained in:
Kris Maglione
2010-10-04 17:15:37 -04:00
parent 476c908da1
commit 871085f917
7 changed files with 47 additions and 9 deletions

View File

@@ -25,6 +25,19 @@ const FailedAssertion = Class("FailedAssertion", Error, {
}
});
deprecated.seen = {};
function deprecated(fn)
function deprecatedMethod() {
let frame = Components.stack.caller;
let caller = frame.filename + ":" + frame.lineNumber;
if (frame.filename != "chrome://dactyl/content/javascript.js" &&
!set.add(deprecated.seen, caller))
dactyl.echoerr(caller + ": " +
(this.className || this.constructor.className) + "." + fn.name +
" is deprecated");
return fn.apply(this, arguments);
}
const Dactyl = Module("dactyl", {
init: function () {
window.dactyl = this;
@@ -689,7 +702,10 @@ const Dactyl = Module("dactyl", {
*
* These are set and accessed with the "g:" prefix.
*/
globalVariables: {},
_globalVariables: {},
globalVariables: Class.Property({
get: deprecated(function globalVariables() this._globalVariables)
}),
loadPlugins: function () {
function sourceDirectory(dir) {