From 2ce4f70094d3c56a608b3477348b7c5a0f797c74 Mon Sep 17 00:00:00 2001 From: Steven Orvell Date: Fri, 4 May 2018 15:51:53 -0700 Subject: [PATCH] gestures: Avoid spreading non-iterable in older browsers Instead just convert to array. --- lib/utils/gestures.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/utils/gestures.js b/lib/utils/gestures.js index 601409defa..3a87b953d1 100644 --- a/lib/utils/gestures.js +++ b/lib/utils/gestures.js @@ -125,7 +125,7 @@ function canBeLabelled(el) { * @return {!Array} 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,