MCPcopy
hub / github.com/ampproject/amphtml / addLabels

Method addLabels

third_party/subscriptions-project/swg.js:7875–7885  ·  view source on GitHub ↗

* @param {!Array } labels

(labels)

Source from the content-addressed store, hash-verified

7873 * @param {!Array<string>} labels
7874 */
7875 addLabels(labels) {
7876 if (labels && labels.length > 0) {
7877 const newLabels = [].concat(this.context_.getLabelList());
7878 for (const label of labels) {
7879 if (newLabels.indexOf(label) == -1) {
7880 newLabels.push(label);
7881 }
7882 }
7883 this.context_.setLabelList(newLabels);
7884 }
7885 }
7886
7887 /**
7888 * @return {!HTMLIFrameElement}

Callers 3

startMethod · 0.95
constructorMethod · 0.80
configure_Method · 0.80

Calls 4

concatMethod · 0.80
getLabelListMethod · 0.80
setLabelListMethod · 0.80
pushMethod · 0.45

Tested by

no test coverage detected