Bug 813623. Fix Xrays to actually work correctly for static methods and properties. r=peterv

This commit is contained in:
Boris Zbarsky 2012-11-26 21:14:45 -05:00
parent e6f9803bf5
commit 3727b0d820
2 changed files with 2 additions and 5 deletions

View File

@ -1337,10 +1337,6 @@ class PropertyArrays():
return [ "staticMethods", "staticAttrs", "methods", "attrs",
"unforgeableAttrs", "consts" ]
@staticmethod
def xrayRelevantArrayNames():
return [ "methods", "attrs", "unforgeableAttrs", "consts" ]
def hasChromeOnly(self):
return any(getattr(self, a).hasChromeOnly() for a in self.arrayNames())
def hasNonChromeOnly(self):
@ -1417,7 +1413,7 @@ class CGCreateInterfaceObjectsMethod(CGAbstractMethod):
# There is no need to init any IDs in workers, because worker bindings
# don't have Xrays.
if not self.descriptor.workers:
for var in self.properties.xrayRelevantArrayNames():
for var in self.properties.arrayNames():
props = getattr(self.properties, var)
# We only have non-chrome ids to init if we have no chrome ids.
if props.hasChromeOnly():

View File

@ -186,6 +186,7 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=741267
for (var i in url) {
url[i];
}
isnot(url.createObjectURL, undefined, "Should have a createObjectURL");
ok(true, "We didn't crash!");
} catch (e) {
ok(false, "URL interface object manipulation via an Xray shouldn't throw" + e);