This commit is contained in:
hyatt%netscape.com 2000-05-13 23:02:12 +00:00
Родитель f9f60f84de
Коммит b05a016994
4 изменённых файлов: 12 добавлений и 8 удалений

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

@ -115,8 +115,10 @@ nsBindingManager::SetBinding(nsIContent* aContent, nsIXBLBinding* aBinding )
mBindingTable = new nsSupportsHashtable;
nsISupportsKey key(aContent);
if (aBinding)
mBindingTable->Put(&key, aBinding);
if (aBinding) {
nsIXBLBinding* oldBinding = NS_STATIC_CAST(nsIXBLBinding*, mBindingTable->Put(&key, aBinding));
NS_IF_RELEASE(oldBinding);
}
else
mBindingTable->Remove(&key);

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

@ -854,7 +854,7 @@ nsXBLBinding::InstallProperties(nsIContent* aBoundElement)
// destruction of any initial value that might be set.
// This means we only have to worry about defining the getter
// or setter.
rv = ::JS_DefineUCProperty(cx, (JSObject*)mScriptObject, name.GetUnicode(),
::JS_DefineUCProperty(cx, (JSObject*)mScriptObject, name.GetUnicode(),
name.Length(), JSVAL_VOID,
(JSPropertyOp) getFunc,
(JSPropertyOp) setFunc,
@ -887,7 +887,7 @@ nsXBLBinding::InstallProperties(nsIContent* aBoundElement)
if (!undefined) {
// Define that value as a property
rv = ::JS_DefineUCProperty(cx, (JSObject*)mScriptObject, name.GetUnicode(),
::JS_DefineUCProperty(cx, (JSObject*)mScriptObject, name.GetUnicode(),
name.Length(), result,
nsnull, nsnull,
attrs);

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

@ -115,8 +115,10 @@ nsBindingManager::SetBinding(nsIContent* aContent, nsIXBLBinding* aBinding )
mBindingTable = new nsSupportsHashtable;
nsISupportsKey key(aContent);
if (aBinding)
mBindingTable->Put(&key, aBinding);
if (aBinding) {
nsIXBLBinding* oldBinding = NS_STATIC_CAST(nsIXBLBinding*, mBindingTable->Put(&key, aBinding));
NS_IF_RELEASE(oldBinding);
}
else
mBindingTable->Remove(&key);

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

@ -854,7 +854,7 @@ nsXBLBinding::InstallProperties(nsIContent* aBoundElement)
// destruction of any initial value that might be set.
// This means we only have to worry about defining the getter
// or setter.
rv = ::JS_DefineUCProperty(cx, (JSObject*)mScriptObject, name.GetUnicode(),
::JS_DefineUCProperty(cx, (JSObject*)mScriptObject, name.GetUnicode(),
name.Length(), JSVAL_VOID,
(JSPropertyOp) getFunc,
(JSPropertyOp) setFunc,
@ -887,7 +887,7 @@ nsXBLBinding::InstallProperties(nsIContent* aBoundElement)
if (!undefined) {
// Define that value as a property
rv = ::JS_DefineUCProperty(cx, (JSObject*)mScriptObject, name.GetUnicode(),
::JS_DefineUCProperty(cx, (JSObject*)mScriptObject, name.GetUnicode(),
name.Length(), result,
nsnull, nsnull,
attrs);