Bug 1357486: Part 0d - Propagate clonable console message args to the parent process. r=aswan

MozReview-Commit-ID: Bkecqr7hRvx
This commit is contained in:
Kris Maglione
2017-07-07 14:34:37 -07:00
parent d0a6dc0361
commit 279afd4582

View File

@@ -79,7 +79,13 @@ ContentProcessSingleton.prototype = {
for (let arg of consoleMsg.arguments) {
if ((typeof arg == "object" || typeof arg == "function") &&
arg !== null) {
arg = unavailString;
try {
// If the argument is clonable, then send it as-is. If
// cloning fails, fall back to the unavailable string.
arg = Cu.cloneInto(arg, {});
} catch (e) {
arg = unavailString;
}
totalArgLength += unavailStringLength;
} else if (typeof arg == "string") {
totalArgLength += arg.length * 2; // 2-bytes per char