Allow setting "expando" properties on XPCNativeWrapper. Bug 300325, r=jst,

sr+a=brendan
This commit is contained in:
bzbarsky%mit.edu 2005-07-13 21:10:37 +00:00
Родитель b7ce598a6b
Коммит 1319733200
1 изменённых файлов: 4 добавлений и 8 удалений

Просмотреть файл

@ -385,9 +385,9 @@ XPC_NW_GetOrSetProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp,
// interface :) // interface :)
XPCNativeInterface* iface = ccx.GetInterface(); XPCNativeInterface* iface = ccx.GetInterface();
if (!iface) { if (!iface) {
// No interface, no property -- unless we're getting an indexed // No interface, no IDL property. Check whet her we're getting an indexed
// property such as frames[0]. Handle that as a special case // property such as frames[0]. Handle that as a special case here, now
// here, now that we know there's no XPConnected .item() method. // that we know there's no XPConnected .item() method.
if (methodName != id) { if (methodName != id) {
jsid index_id; jsid index_id;
@ -425,8 +425,6 @@ XPC_NW_GetOrSetProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp,
} }
} }
*vp = JSVAL_VOID;
return JS_TRUE; return JS_TRUE;
} }
@ -434,9 +432,7 @@ XPC_NW_GetOrSetProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp,
XPCNativeMember* member = ccx.GetMember(); XPCNativeMember* member = ccx.GetMember();
NS_ASSERTION(member, "not doing IDispatch, how'd this happen?"); NS_ASSERTION(member, "not doing IDispatch, how'd this happen?");
if (!member) { if (!member) {
// No member, no property. // No member, no IDL property to expose.
*vp = JSVAL_VOID;
return JS_TRUE; return JS_TRUE;
} }