Bug 818379. Make sure interface objects have a 'length' property even if they're not real function objects. r=peterv

This commit is contained in:
Boris Zbarsky 2012-12-14 14:10:49 -05:00
parent b3a1d6f000
commit a7a70f4dc6

View File

@ -271,6 +271,11 @@ CreateInterfaceObject(JSContext* cx, JSObject* global,
}
js::SetFunctionNativeReserved(toStringObj, TOSTRING_NAME_RESERVED_SLOT,
STRING_TO_JSVAL(str));
if (!JS_DefineProperty(cx, constructor, "length", JS::Int32Value(ctorNargs),
nullptr, nullptr, JSPROP_READONLY | JSPROP_PERMANENT)) {
return NULL;
}
}
if (properties) {