Bug 855025. Always do Xrays for DOM interface objects. r=peterv

This commit is contained in:
Boris Zbarsky 2013-03-27 22:47:25 -04:00
parent 6a4b35c2b8
commit d74ba794b4
3 changed files with 11 additions and 9 deletions

View File

@ -1640,12 +1640,7 @@ class CGCreateInterfaceObjectsMethod(CGAbstractMethod):
protoClass = "nullptr"
protoCache = "nullptr"
if needInterfaceObject:
if self.descriptor.interface.isCallback():
# We don't have slots to store the named constructors.
assert len(self.descriptor.interface.namedConstructors) == 0
interfaceClass = "js::Jsvalify(&js::ObjectClass)"
else:
interfaceClass = "&InterfaceObjectClass.mBase"
interfaceClass = "&InterfaceObjectClass.mBase"
interfaceCache = "&protoAndIfaceArray[constructors::id::%s]" % self.descriptor.name
else:
# We don't have slots to store the named constructors.
@ -6643,8 +6638,7 @@ class CGDescriptor(CGThing):
cgThings.append(CGClassConstructor(descriptor,
descriptor.interface.ctor()))
cgThings.append(CGClassHasInstanceHook(descriptor))
if not descriptor.interface.isCallback():
cgThings.append(CGInterfaceObjectJSClass(descriptor, properties))
cgThings.append(CGInterfaceObjectJSClass(descriptor, properties))
if descriptor.needsConstructHookHolder():
cgThings.append(CGClassConstructHookHolder(descriptor))
cgThings.append(CGNamedConstructors(descriptor))

View File

@ -70,7 +70,6 @@
"CharacterData interface: document.createTextNode(\"abc\") must inherit property \"remove\" with the proper type (7)": true,
"CharacterData interface: xmlDoc.createProcessingInstruction(\"abc\", \"def\") must inherit property \"remove\" with the proper type (7)": true,
"CharacterData interface: document.createComment(\"abc\") must inherit property \"remove\" with the proper type (7)": true,
"NodeFilter interface: existence and properties of interface object": true,
"NodeFilter interface: existence and properties of interface prototype object": true,
"NodeFilter interface: existence and properties of interface prototype object's \"constructor\" property": true,
"NodeFilter interface: constant FILTER_ACCEPT on interface prototype object": true,

View File

@ -224,6 +224,15 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=741267
ok(false, "Should be able to create an EventSource in a sandbox " + e);
}
try {
var nodeFilterIface = Components.utils.evalInSandbox(
'NodeFilter.myExpando = "FAIL"; NodeFilter', sandbox);
is(nodeFilterIface.myExpando, undefined,
"Should have Xrays for callback interface objects");
} catch (e) {
ok(false, "Should be able to return NodeFilter from a sandbox " + e);
}
SimpleTest.finish();
}