Bug 747819. When wrapping non-prefable objects, don't generate a fallback-to-XPConnect codepath. r=peterv

This commit is contained in:
Boris Zbarsky 2012-04-26 00:42:20 -04:00
parent e2ed0fe94a
commit b12a3e7927

View File

@ -1468,14 +1468,17 @@ def getWrapTemplateForTypeImpl(type, result, descriptorProvider,
if (WrapNewBindingObject(cx, obj, %s, ${jsvalPtr})) {
return true;
}""" % result
if descriptor.workers:
# Worker bindings can only fail to wrap as a new-binding object
# if they already threw an exception
# We don't support prefable stuff in workers.
assert(not descriptor.prefable or not descriptor.workers)
if not descriptor.prefable:
# Non-prefable bindings can only fail to wrap as a new-binding object
# if they already threw an exception. Same thing for
# non-prefable bindings.
wrappingCode += """
MOZ_ASSERT(JS_IsExceptionPending(cx));
return false;"""
else:
# Try old-style wrapping for non-worker bindings
# Try old-style wrapping for bindings which might be preffed off.
wrappingCode += """
return HandleNewBindingWrappingFailure(cx, obj, %s, ${jsvalPtr});""" % result
else: