This commit is contained in:
Ms2ger 2011-06-23 16:36:56 +02:00
Родитель 3885bce98f f927fdef9d
Коммит 163f219284
1 изменённых файлов: 4 добавлений и 7 удалений

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

@ -369,7 +369,7 @@ nsFrameMessageManager::ReceiveMessage(nsISupports* aTarget,
jsval targetv;
nsContentUtils::WrapNative(ctx,
JS_GetGlobalForObject(ctx, object),
aTarget, &targetv, nsnull, PR_TRUE);
aTarget, &targetv);
// To keep compatibility with e10s message manager,
// 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;
if (!aJSON.IsEmpty()) {
if (!JS_ParseJSON(ctx, (jschar*)nsString(aJSON).get(),
@ -404,7 +400,8 @@ nsFrameMessageManager::ReceiveMessage(nsISupports* aTarget,
JS_DefineProperty(ctx, param, "sync",
BOOLEAN_TO_JSVAL(aSync), 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;
@ -424,7 +421,7 @@ nsFrameMessageManager::ReceiveMessage(nsISupports* aTarget,
}
nsContentUtils::WrapNative(ctx,
JS_GetGlobalForObject(ctx, object),
defaultThisValue, &thisValue, nsnull, PR_TRUE);
defaultThisValue, &thisValue);
} else {
// If the listener is a JS object which has receiveMessage function:
NS_ENSURE_STATE(JS_GetProperty(ctx, object, "receiveMessage",