Bug 856841. Don't pass in an implicit JSContext based on argument or return value types for JS-implemented interfaces. r=mccr8

This commit is contained in:
Boris Zbarsky 2013-04-03 22:22:16 -04:00
parent d1d7bbfca7
commit 0bbbeb9739
2 changed files with 15 additions and 9 deletions

View File

@ -3921,8 +3921,9 @@ if (global.Failed()) {
""" % globalObjectType))
argsPre.append("global")
needsCx = needCx(returnType, arguments, self.extendedAttributes,
descriptor)
needsCx = (not descriptor.interface.isJSImplemented() and
needCx(returnType, arguments, self.extendedAttributes,
descriptor))
if needsCx and not (static and descriptor.workers):
argsPre.append("cx")
@ -8005,7 +8006,8 @@ class CGJSImplMethod(CGNativeMember):
signature,
descriptor.getExtendedAttributes(method),
breakAfter=breakAfter,
variadicIsSequence=True)
variadicIsSequence=True,
passCxAsNeeded=False)
self.signature = signature
if isConstructor:
self.body = self.getConstructorImpl()
@ -8068,7 +8070,8 @@ class CGJSImplGetter(CGNativeMember):
attr),
(attr.type, []),
descriptor.getExtendedAttributes(attr,
getter=True))
getter=True),
passCxAsNeeded=False)
self.body = self.getImpl()
def getImpl(self):
@ -8083,7 +8086,8 @@ class CGJSImplSetter(CGNativeMember):
(BuiltinTypes[IDLBuiltinType.Types.void],
[FakeArgument(attr.type, attr)]),
descriptor.getExtendedAttributes(attr,
setter=True))
setter=True),
passCxAsNeeded=False)
self.body = self.getImpl()
def getImpl(self):

View File

@ -311,22 +311,24 @@ interface TestJSImplInterface {
//void passOptionalNullableTreatAsNullCallback(optional TestTreatAsNullCallback? arg);
void passOptionalNullableTreatAsNullCallbackWithDefaultValue(optional TestTreatAsNullCallback? arg = null);
/* The rest of these are untested.
// Any types
void passAny(any arg);
void passOptionalAny(optional any arg);
void passAnyDefaultNull(optional any arg = null);
any receiveAny();
// object types
void passObject(object arg);
// object types. Unfortunately, non-nullable object is inconsistently
// represented as either JSObject* (for callbacks) or JSObject& (for
// non-callbacks), so we can't handle those yet. See bug 856911.
//(BUG 856911) void passObject(object arg);
void passNullableObject(object? arg);
void passOptionalObject(optional object arg);
//(BUG 856911) void passOptionalObject(optional object arg);
void passOptionalNullableObject(optional object? arg);
void passOptionalNullableObjectWithDefaultValue(optional object? arg = null);
object receiveObject();
object? receiveNullableObject();
/* The rest of these are untested.
// Union types
void passUnion((object or long) arg);
void passUnionWithNullable((object? or long) arg);