gestures: Avoid spreading non-iterable in older browsers

Instead just convert to array.
This commit is contained in:
Steven Orvell
2018-05-04 15:51:53 -07:00
parent 503f56318e
commit 2ce4f70094

View File

@@ -125,7 +125,7 @@ function canBeLabelled(el) {
* @return {!Array<!HTMLLabelElement>} Relevant label for `el`
*/
function matchingLabels(el) {
let labels = [...(/** @type {HTMLInputElement} */((el).labels || []))];
let labels = Array.prototype.slice.call(/** @type {HTMLInputElement} */(el).labels);
// IE doesn't have `labels` and Safari doesn't populate `labels`
// if element is in a shadowroot.
// In this instance, finding the non-ancestor labels is enough,