Bug 1540149 - Don't use Array.map in prepareConsoleMessageForRemote. r=bgrins.

`Array.map` triggers a deprecation warnings, and it
turns out we can use `.map`  directly on the objects
we were calling `Array.map` on.

Differential Revision: https://phabricator.services.mozilla.com/D25506

--HG--
extra : moz-landing-system : lando
This commit is contained in:
Nicolas Chevobbe 2019-03-30 20:06:44 +00:00
parent f99907635a
commit c94181f930

View File

@ -1703,17 +1703,20 @@ WebConsoleActor.prototype =
delete result.consoleID;
if (result.stacktrace) {
result.stacktrace = Array.map(result.stacktrace, (frame) => {
return { ...frame, sourceId: this.getActorIdForInternalSourceId(frame.sourceId) };
result.stacktrace = result.stacktrace.map(frame => {
return {
...frame,
sourceId: this.getActorIdForInternalSourceId(frame.sourceId),
};
});
}
result.arguments = Array.map(message.arguments || [], (obj) => {
result.arguments = (message.arguments || []).map(obj => {
const dbgObj = this.makeDebuggeeValue(obj, useObjectGlobal);
return this.createValueGrip(dbgObj);
});
result.styles = Array.map(message.styles || [], (string) => {
result.styles = (message.styles || []).map(string => {
return this.createValueGrip(string);
});