Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Check property existence before trying to use them

  • Loading branch information...
commit 528d0d2bee5207feeae672307cd61a8268fbbb3e 1 parent 970dbcf
@Mossop authored
View
2  packages/api-utils/lib/cuddlefish.js
@@ -191,7 +191,7 @@ const Require = iced(function Require(loader, module) {
let { prefixURI, modules } = loader;
let base = module.path; // base module path.
let manifest = loader.manifest[base]; // manifest of base module.
- let requirer = modules[base]; // same module, but from loader cache.
+ let requirer = base in modules ? modules[base] : null; // same module, but from loader cache.
return iced(override(function require(id) {
if (!id)
throw Error("you must provide a module name when calling require() from "
View
2  packages/api-utils/lib/xpcom.js
@@ -16,7 +16,7 @@ const { uuid } = require('./uuid');
// components can be easily implement by extending it.
const Unknown = new function() {
function hasInterface(component, iid) {
- return component &&
+ return component && component.interfaces &&
( component.interfaces.some(function(id) iid.equals(Ci[id])) ||
component.implements.some(function($) hasInterface($, iid)) ||
hasInterface(Object.getPrototypeOf(component), iid));
Please sign in to comment.
Something went wrong with that request. Please try again.