forked from mirrors/gecko-dev
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:
parent
3ad6fe2ca8
commit
e7ec1ff308
3 changed files with 2 additions and 51 deletions
|
|
@ -5,11 +5,7 @@
|
|||
"use strict";
|
||||
|
||||
const { extend } = require("devtools/shared/extend");
|
||||
var {
|
||||
findPlaceholders,
|
||||
describeTemplate,
|
||||
getPath,
|
||||
} = require("devtools/shared/protocol/utils");
|
||||
var { findPlaceholders, getPath } = require("devtools/shared/protocol/utils");
|
||||
var { types } = require("devtools/shared/protocol/types");
|
||||
|
||||
/**
|
||||
|
|
@ -75,10 +71,6 @@ Request.prototype = {
|
|||
}
|
||||
return fnArgs;
|
||||
},
|
||||
|
||||
describe: function() {
|
||||
return describeTemplate(this.template);
|
||||
},
|
||||
};
|
||||
|
||||
exports.Request = Request;
|
||||
|
|
@ -120,13 +112,6 @@ Arg.prototype = {
|
|||
read: function(v, ctx, outArgs) {
|
||||
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.
|
||||
|
|
@ -173,13 +158,6 @@ Option.prototype = extend(Arg.prototype, {
|
|||
}
|
||||
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.
|
||||
|
|
|
|||
|
|
@ -4,11 +4,7 @@
|
|||
|
||||
"use strict";
|
||||
|
||||
var {
|
||||
findPlaceholders,
|
||||
getPath,
|
||||
describeTemplate,
|
||||
} = require("devtools/shared/protocol/utils");
|
||||
var { findPlaceholders, getPath } = require("devtools/shared/protocol/utils");
|
||||
var { types } = require("devtools/shared/protocol/types");
|
||||
|
||||
/**
|
||||
|
|
@ -76,10 +72,6 @@ Response.prototype = {
|
|||
const v = getPath(packet, this.path);
|
||||
return this.retVal.read(v, ctx);
|
||||
},
|
||||
|
||||
describe: function() {
|
||||
return describeTemplate(this.template);
|
||||
},
|
||||
};
|
||||
|
||||
exports.Response = Response;
|
||||
|
|
@ -105,12 +97,6 @@ RetVal.prototype = {
|
|||
read: function(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.
|
||||
|
|
|
|||
|
|
@ -4,19 +4,6 @@
|
|||
|
||||
"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
|
||||
* paths.
|
||||
|
|
|
|||
Loading…
Reference in a new issue