Bug 767930. Add support for typed array return values (as just JSObject*) in WebIDL bindings. r=peterv

This commit is contained in:
Boris Zbarsky 2012-08-28 13:10:09 -04:00
parent c8cd9213e7
commit 50289e9c67
3 changed files with 4 additions and 2 deletions

View File

@ -2670,7 +2670,7 @@ if (!%(resultStr)s) {
# NB: setValue(..., True) calls JS_WrapValue(), so is fallible
return (setValue(result, True), False)
if type.isObject():
if type.isObject() or type.isSpiderMonkeyInterface():
# See comments in WrapNewBindingObject explaining why we need
# to wrap here.
if type.nullable():
@ -2794,7 +2794,7 @@ def getRetvalDeclarationForType(returnType, descriptorProvider,
return CGGeneric("JSObject*"), False
if returnType.tag() is IDLType.Tags.any:
return CGGeneric("JS::Value"), False
if returnType.isObject():
if returnType.isObject() or returnType.isSpiderMonkeyInterface():
return CGGeneric("JSObject*"), False
if returnType.isSequence():
nullable = returnType.nullable()

View File

@ -330,6 +330,7 @@ public:
void PassUint8ClampedArray(Uint8ClampedArray&, ErrorResult&);
void PassFloat32Array(Float32Array&, ErrorResult&);
void PassFloat64Array(Float64Array&, ErrorResult&);
JSObject* ReceiveUint8Array(ErrorResult&);
// String types
void PassString(const nsAString&, ErrorResult&);

View File

@ -228,6 +228,7 @@ interface TestInterface {
void passUint8ClampedArray(Uint8ClampedArray arg);
void passFloat32Array(Float32Array arg);
void passFloat64Array(Float64Array arg);
Uint8Array receiveUint8Array();
// String types
void passString(DOMString arg);