Bug 800857 - Handle getOwnPropertyDescriptor throwing when accessing "displayName", r=past

This commit is contained in:
Victor Porof 2013-10-04 10:33:08 +03:00
parent 47c8a23d58
commit 0845691ee7

View File

@ -2661,9 +2661,15 @@ ObjectActor.prototype = {
// Check if the developer has added a de-facto standard displayName
// property for us to use.
let desc = this.obj.getOwnPropertyDescriptor("displayName");
if (desc && desc.value && typeof desc.value == "string") {
g.userDisplayName = this.threadActor.createValueGrip(desc.value);
try {
let desc = this.obj.getOwnPropertyDescriptor("displayName");
if (desc && desc.value && typeof desc.value == "string") {
g.userDisplayName = this.threadActor.createValueGrip(desc.value);
}
} catch (e) {
// Calling getOwnPropertyDescriptor with displayName might throw
// with "permission denied" errors for some functions.
dumpn(e);
}
// Add source location information.