Bug 561480 - Errors when loading WeaveCrypto.js on older platforms [r=mconnor]

Only register WeaveCrypto if it was able to import scripts.
This commit is contained in:
Edward Lee 2010-05-04 12:15:43 -07:00
Родитель 0c62a45494
Коммит b3b91dc181
1 изменённых файлов: 6 добавлений и 3 удалений

Просмотреть файл

@ -40,8 +40,11 @@ const Ci = Components.interfaces;
const Cr = Components.results; const Cr = Components.results;
Components.utils.import("resource://gre/modules/XPCOMUtils.jsm"); Components.utils.import("resource://gre/modules/XPCOMUtils.jsm");
Components.utils.import("resource://gre/modules/Services.jsm"); try {
Components.utils.import("resource://gre/modules/ctypes.jsm"); Components.utils.import("resource://gre/modules/Services.jsm");
Components.utils.import("resource://gre/modules/ctypes.jsm");
}
catch(ex) {}
function WeaveCrypto() { function WeaveCrypto() {
this.init(); this.init();
@ -1120,7 +1123,7 @@ WeaveCrypto.prototype = {
} }
}; };
let component = [WeaveCrypto]; let component = Services == null || ctypes == null ? [] : [WeaveCrypto];
function NSGetModule (compMgr, fileSpec) { function NSGetModule (compMgr, fileSpec) {
return XPCOMUtils.generateModule(component); return XPCOMUtils.generateModule(component);
} }