зеркало из https://github.com/mozilla/gecko-dev.git
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:
Родитель
1da98657a9
Коммит
128eb0578f
|
@ -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);
|
||||||
}
|
}
|
||||||
|
|
Загрузка…
Ссылка в новой задаче