Bug 1676980 - [devtools] Remove unused protocol/utils describeTemplate() helper r=ochameau

Depends on D96935

Differential Revision: https://phabricator.services.mozilla.com/D96939
This commit is contained in:
Julian Descottes 2020-11-13 10:21:36 +00:00
parent 3ad6fe2ca8
commit e7ec1ff308
3 changed files with 2 additions and 51 deletions

View file

@ -5,11 +5,7 @@
"use strict"; "use strict";
const { extend } = require("devtools/shared/extend"); const { extend } = require("devtools/shared/extend");
var { var { findPlaceholders, getPath } = require("devtools/shared/protocol/utils");
findPlaceholders,
describeTemplate,
getPath,
} = require("devtools/shared/protocol/utils");
var { types } = require("devtools/shared/protocol/types"); var { types } = require("devtools/shared/protocol/types");
/** /**
@ -75,10 +71,6 @@ Request.prototype = {
} }
return fnArgs; return fnArgs;
}, },
describe: function() {
return describeTemplate(this.template);
},
}; };
exports.Request = Request; exports.Request = Request;
@ -120,13 +112,6 @@ Arg.prototype = {
read: function(v, ctx, outArgs) { read: function(v, ctx, outArgs) {
outArgs[this.index] = this.type.read(v, ctx); outArgs[this.index] = this.type.read(v, ctx);
}, },
describe: function() {
return {
_arg: this.index,
type: this.type.name,
};
},
}; };
// Outside of protocol.js, Arg is called as factory method, without the new keyword. // Outside of protocol.js, Arg is called as factory method, without the new keyword.
@ -173,13 +158,6 @@ Option.prototype = extend(Arg.prototype, {
} }
outArgs[this.index][name] = this.type.read(v, ctx); outArgs[this.index][name] = this.type.read(v, ctx);
}, },
describe: function() {
return {
_option: this.index,
type: this.type.name,
};
},
}); });
// Outside of protocol.js, Option is called as factory method, without the new keyword. // Outside of protocol.js, Option is called as factory method, without the new keyword.

View file

@ -4,11 +4,7 @@
"use strict"; "use strict";
var { var { findPlaceholders, getPath } = require("devtools/shared/protocol/utils");
findPlaceholders,
getPath,
describeTemplate,
} = require("devtools/shared/protocol/utils");
var { types } = require("devtools/shared/protocol/types"); var { types } = require("devtools/shared/protocol/types");
/** /**
@ -76,10 +72,6 @@ Response.prototype = {
const v = getPath(packet, this.path); const v = getPath(packet, this.path);
return this.retVal.read(v, ctx); return this.retVal.read(v, ctx);
}, },
describe: function() {
return describeTemplate(this.template);
},
}; };
exports.Response = Response; exports.Response = Response;
@ -105,12 +97,6 @@ RetVal.prototype = {
read: function(v, ctx) { read: function(v, ctx) {
return this.type.read(v, ctx); return this.type.read(v, ctx);
}, },
describe: function() {
return {
_retval: this.type.name,
};
},
}; };
// Outside of protocol.js, RetVal is called as factory method, without the new keyword. // Outside of protocol.js, RetVal is called as factory method, without the new keyword.

View file

@ -4,19 +4,6 @@
"use strict"; "use strict";
function describeTemplate(template) {
return JSON.parse(
JSON.stringify(template, (key, value) => {
if (value.describe) {
return value.describe();
}
return value;
})
);
}
exports.describeTemplate = describeTemplate;
/** /**
* Find Placeholders in the template and save them along with their * Find Placeholders in the template and save them along with their
* paths. * paths.