Pass the address of the jsval instead of the value (which was null). This helps allow you to access xp-connect

objects from xbl.
r=hyatt
This commit is contained in:
mscott%netscape.com 2000-04-05 04:00:13 +00:00
Родитель 1da98657a9
Коммит 128eb0578f
2 изменённых файлов: 6 добавлений и 6 удалений

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

@ -829,17 +829,17 @@ nsXBLBinding::InstallProperties(nsIContent* aBoundElement)
if (!answer.IsEmpty()) { if (!answer.IsEmpty()) {
// Evaluate our script and obtain a value. // Evaluate our script and obtain a value.
jsval* result = nsnull; jsval result = nsnull;
PRBool undefined; PRBool undefined;
rv = context->EvaluateStringWithValue(answer, rv = context->EvaluateStringWithValue(answer,
mScriptObject, mScriptObject,
nsnull, nsnull, 0, nsnull, nsnull, nsnull, 0, nsnull,
(void*)result, &undefined); (void*) &result, &undefined);
if (!undefined) { if (!undefined) {
// Define that value as a property // Define that value as a property
rv = ::JS_DefineUCProperty(cx, (JSObject*)mScriptObject, name.GetUnicode(), rv = ::JS_DefineUCProperty(cx, (JSObject*)mScriptObject, name.GetUnicode(),
name.Length(), *result, name.Length(), result,
nsnull, nsnull, nsnull, nsnull,
attrs); attrs);
} }

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

@ -829,17 +829,17 @@ nsXBLBinding::InstallProperties(nsIContent* aBoundElement)
if (!answer.IsEmpty()) { if (!answer.IsEmpty()) {
// Evaluate our script and obtain a value. // Evaluate our script and obtain a value.
jsval* result = nsnull; jsval result = nsnull;
PRBool undefined; PRBool undefined;
rv = context->EvaluateStringWithValue(answer, rv = context->EvaluateStringWithValue(answer,
mScriptObject, mScriptObject,
nsnull, nsnull, 0, nsnull, nsnull, nsnull, 0, nsnull,
(void*)result, &undefined); (void*) &result, &undefined);
if (!undefined) { if (!undefined) {
// Define that value as a property // Define that value as a property
rv = ::JS_DefineUCProperty(cx, (JSObject*)mScriptObject, name.GetUnicode(), rv = ::JS_DefineUCProperty(cx, (JSObject*)mScriptObject, name.GetUnicode(),
name.Length(), *result, name.Length(), result,
nsnull, nsnull, nsnull, nsnull,
attrs); attrs);
} }