Bug 1225828 - Avoid 'Object in compartment marked as invisible to Debugger' exceptions in the Browser Console / Browser Toolbox;r=fitzgen

This commit is contained in:
Brian Grinstead
2015-11-19 07:11:56 -08:00
parent f1c5b31c57
commit fab05dec79
3 changed files with 30 additions and 6 deletions

View File

@@ -325,8 +325,13 @@ exports.getProperty = function getProperty(aObj, aKey) {
exports.hasSafeGetter = function hasSafeGetter(aDesc) {
// Scripted functions that are CCWs will not appear scripted until after
// unwrapping.
let fn = aDesc.get.unwrap();
return fn && fn.callable && fn.class == "Function" && fn.script === undefined;
try {
let fn = aDesc.get.unwrap();
return fn && fn.callable && fn.class == "Function" && fn.script === undefined;
} catch(e) {
// Avoid exception 'Object in compartment marked as invisible to Debugger'
return false;
}
};
/**