mirror of
https://github.com/gryf/pentadactyl-pm.git
synced 2026-01-04 02:54:13 +01:00
Fix minor bugs and remove dead code.
--HG-- extra : rebase_source : 2b724d92734c547be0fc808a4e39fde0bc339542
This commit is contained in:
@@ -1144,7 +1144,10 @@ var Buffer = Module("Buffer", {
|
||||
|
||||
let ext = uri.fileExtension || "txt";
|
||||
if (doc.contentType)
|
||||
ext = services.mime.getPrimaryExtension(doc.contentType, ext);
|
||||
try {
|
||||
ext = services.mime.getPrimaryExtension(doc.contentType, ext);
|
||||
}
|
||||
catch (e) {}
|
||||
|
||||
if (!isString(doc))
|
||||
return io.withTempFiles(function (temp) {
|
||||
|
||||
@@ -125,7 +125,7 @@ var DOM = Class("DOM", {
|
||||
if (val instanceof Ci.nsIDOMNode)
|
||||
return val;
|
||||
|
||||
if (typeof val == "xml" || DOM.isJSONXML(val)) {
|
||||
if (DOM.isJSONXML(val)) {
|
||||
val = dom.constructor(val, dom.document);
|
||||
if (container)
|
||||
container[idx] = val[0];
|
||||
@@ -140,6 +140,9 @@ var DOM = Class("DOM", {
|
||||
return val;
|
||||
}
|
||||
|
||||
if (DOM.isJSONXML(val))
|
||||
val = (function () this).bind(val);
|
||||
|
||||
if (callable(val))
|
||||
return this.each(function (elem, i) {
|
||||
util.withProperErrors(fn, this, munge(val.call(this, elem, i)), elem, i);
|
||||
|
||||
Reference in New Issue
Block a user