зеркало из https://github.com/mozilla/gecko-dev.git
Merge backout.
This commit is contained in:
Коммит
163f219284
|
@ -369,7 +369,7 @@ nsFrameMessageManager::ReceiveMessage(nsISupports* aTarget,
|
||||||
jsval targetv;
|
jsval targetv;
|
||||||
nsContentUtils::WrapNative(ctx,
|
nsContentUtils::WrapNative(ctx,
|
||||||
JS_GetGlobalForObject(ctx, object),
|
JS_GetGlobalForObject(ctx, object),
|
||||||
aTarget, &targetv, nsnull, PR_TRUE);
|
aTarget, &targetv);
|
||||||
|
|
||||||
// To keep compatibility with e10s message manager,
|
// To keep compatibility with e10s message manager,
|
||||||
// define empty objects array.
|
// define empty objects array.
|
||||||
|
@ -382,10 +382,6 @@ nsFrameMessageManager::ReceiveMessage(nsISupports* aTarget,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
jsval objectsv;
|
|
||||||
if (!JS_WrapValue(ctx, &objectsv))
|
|
||||||
return NS_ERROR_UNEXPECTED;
|
|
||||||
|
|
||||||
jsval json = JSVAL_NULL;
|
jsval json = JSVAL_NULL;
|
||||||
if (!aJSON.IsEmpty()) {
|
if (!aJSON.IsEmpty()) {
|
||||||
if (!JS_ParseJSON(ctx, (jschar*)nsString(aJSON).get(),
|
if (!JS_ParseJSON(ctx, (jschar*)nsString(aJSON).get(),
|
||||||
|
@ -404,7 +400,8 @@ nsFrameMessageManager::ReceiveMessage(nsISupports* aTarget,
|
||||||
JS_DefineProperty(ctx, param, "sync",
|
JS_DefineProperty(ctx, param, "sync",
|
||||||
BOOLEAN_TO_JSVAL(aSync), NULL, NULL, JSPROP_ENUMERATE);
|
BOOLEAN_TO_JSVAL(aSync), NULL, NULL, JSPROP_ENUMERATE);
|
||||||
JS_DefineProperty(ctx, param, "json", json, NULL, NULL, JSPROP_ENUMERATE);
|
JS_DefineProperty(ctx, param, "json", json, NULL, NULL, JSPROP_ENUMERATE);
|
||||||
JS_DefineProperty(ctx, param, "objects", objectsv, NULL, NULL, JSPROP_ENUMERATE);
|
JS_DefineProperty(ctx, param, "objects", OBJECT_TO_JSVAL(aObjectsArray),
|
||||||
|
NULL, NULL, JSPROP_ENUMERATE);
|
||||||
|
|
||||||
jsval thisValue = JSVAL_VOID;
|
jsval thisValue = JSVAL_VOID;
|
||||||
|
|
||||||
|
@ -424,7 +421,7 @@ nsFrameMessageManager::ReceiveMessage(nsISupports* aTarget,
|
||||||
}
|
}
|
||||||
nsContentUtils::WrapNative(ctx,
|
nsContentUtils::WrapNative(ctx,
|
||||||
JS_GetGlobalForObject(ctx, object),
|
JS_GetGlobalForObject(ctx, object),
|
||||||
defaultThisValue, &thisValue, nsnull, PR_TRUE);
|
defaultThisValue, &thisValue);
|
||||||
} else {
|
} else {
|
||||||
// If the listener is a JS object which has receiveMessage function:
|
// If the listener is a JS object which has receiveMessage function:
|
||||||
NS_ENSURE_STATE(JS_GetProperty(ctx, object, "receiveMessage",
|
NS_ENSURE_STATE(JS_GetProperty(ctx, object, "receiveMessage",
|
||||||
|
|
Загрузка…
Ссылка в новой задаче