From 1e90ffacec133b52167b59a3325ff67a87354904 Mon Sep 17 00:00:00 2001 From: Kevin Schmidt Date: Tue, 16 Oct 2018 09:20:20 -0600 Subject: [PATCH] Avoid spread operator to fix TypeScript errors --- src/ol/format/filter/And.js | 3 +-- src/ol/format/filter/LogicalNary.js | 4 ++-- src/ol/format/filter/Or.js | 3 +-- 3 files changed, 4 insertions(+), 6 deletions(-) diff --git a/src/ol/format/filter/And.js b/src/ol/format/filter/And.js index 209191f8ef..ccb63c397e 100644 --- a/src/ol/format/filter/And.js +++ b/src/ol/format/filter/And.js @@ -15,8 +15,7 @@ class And extends LogicalNary { * @param {...import("./Filter.js").default} conditions Conditions. */ constructor(conditions) { - const params = ['And'].concat(Array.prototype.slice.call(arguments)); - super(...params); + super('And', Array.prototype.slice.call(arguments)); } } diff --git a/src/ol/format/filter/LogicalNary.js b/src/ol/format/filter/LogicalNary.js index c97759f2e2..d785e411b9 100644 --- a/src/ol/format/filter/LogicalNary.js +++ b/src/ol/format/filter/LogicalNary.js @@ -15,7 +15,7 @@ class LogicalNary extends Filter { /** * @param {!string} tagName The XML tag name for this filter. - * @param {...import("./Filter.js").default} conditions Conditions. + * @param {Array} conditions Conditions. */ constructor(tagName, conditions) { @@ -24,7 +24,7 @@ class LogicalNary extends Filter { /** * @type {Array} */ - this.conditions = Array.prototype.slice.call(arguments, 1); + this.conditions = conditions; assert(this.conditions.length >= 2, 57); // At least 2 conditions are required. } diff --git a/src/ol/format/filter/Or.js b/src/ol/format/filter/Or.js index 9500c89d0f..545ad4d196 100644 --- a/src/ol/format/filter/Or.js +++ b/src/ol/format/filter/Or.js @@ -14,8 +14,7 @@ class Or extends LogicalNary { * @param {...import("./Filter.js").default} conditions Conditions. */ constructor(conditions) { - const params = ['Or'].concat(Array.prototype.slice.call(arguments)); - super(...params); + super('Or', Array.prototype.slice.call(arguments)); } }