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
parent 1da98657a9
commit 128eb0578f
2 changed files with 6 additions and 6 deletions

View File

@ -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);
} }

View File

@ -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);
} }