1
0
mirror of https://github.com/gryf/pentadactyl-pm.git synced 2025-12-28 08:32:26 +01:00

Fix bugs and deprecate stuff.

This commit is contained in:
Kris Maglione
2012-12-20 19:07:28 -08:00
parent d0e53df525
commit fc4851458b
3 changed files with 10 additions and 7 deletions

View File

@@ -270,8 +270,8 @@ function deprecated(alternative, fn) {
deprecated.warn = function warn(func, name, alternative, frame) {
if (!func.seenCaller)
func.seenCaller = Set([
"resource://dactyl" + JSMLoader.suffix + "/javascript.jsm",
"resource://dactyl" + JSMLoader.suffix + "/util.jsm"
"resource://dactyl/javascript.jsm",
"resource://dactyl/util.jsm"
]);
frame = frame || Components.stack.caller.caller;

View File

@@ -11,6 +11,7 @@ defineModule("dom", {
lazyRequire("highlight", ["highlight"]);
lazyRequire("messages", ["_"]);
lazyRequire("prefs", ["prefs"]);
lazyRequire("template", ["template"]);
var XBL = "http://www.mozilla.org/xbl";
@@ -1022,6 +1023,9 @@ var DOM = Class("DOM", {
}
for (let [k, v] in Iterator(Ci.nsIDOMKeyEvent)) {
if (!/^DOM_VK_/.test(k))
continue;
this.code_nativeKey[v] = k.substr(4);
k = k.substr(7).toLowerCase();
@@ -1525,9 +1529,9 @@ var DOM = Class("DOM", {
* stored here, keyed to the value thereof.
* @returns {Node}
*/
fromXML: Class.Memoize(function ()
fromXML: deprecated("DOM.fromJSON", { get: function fromXML()
prefs.get("javascript.options.xml.chrome") !== false
&& require("dom-e4x.xml").fromXML),
&& require("dom-e4x").fromXML }),
fromJSON: update(function fromJSON(xml, doc, nodes, namespaces) {
if (!doc)

View File

@@ -89,6 +89,7 @@ var Util = Module("Util", XPCOM([Ci.nsIObserver, Ci.nsISupportsWeakReference]),
parseForm: deprecated("DOM#formData", function parseForm(elem) values(DOM(elem).formData).toArray()),
scrollIntoView: deprecated("DOM#scrollIntoView", function scrollIntoView(elem, alignWithTop) DOM(elem).scrollIntoView(alignWithTop)),
validateMatcher: deprecated("DOM.validateMatcher", { get: function validateMatcher() DOM.validateMatcher }),
xmlToDom: deprecated("DOM.fromJSON", function xmlToDom() DOM.fromXML.apply(DOM, arguments)),
map: deprecated("iter.map", function map(obj, fn, self) iter(obj).map(fn, self).toArray()),
writeToClipboard: deprecated("dactyl.clipboardWrite", function writeToClipboard(str, verbose) util.dactyl.clipboardWrite(str, verbose)),
@@ -1702,9 +1703,7 @@ var Util = Module("Util", XPCOM([Ci.nsIObserver, Ci.nsISupportsWeakReference]),
catch (e) {
throw e.stack ? e : Error(e);
}
},
xmlToDom: function () DOM.fromXML.apply(DOM, arguments)
}
}, {
Array: array
});