From a7b57d7f971338c5747cb60c9f8d7517046e8d6e Mon Sep 17 00:00:00 2001 From: Xavier Cazin Date: Thu, 29 Jun 2017 19:02:33 +0200 Subject: [PATCH] allbefore:include should be the identity function when applied to 1st item (#2842) * fr-FR translation of additional error strings * allbefore:include should be the identity function when applied to the 1st item --- core/modules/filters/x-listops.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/core/modules/filters/x-listops.js b/core/modules/filters/x-listops.js index 3d1f8c506..d9c7b83e6 100644 --- a/core/modules/filters/x-listops.js +++ b/core/modules/filters/x-listops.js @@ -106,7 +106,7 @@ Extended filter operators to manipulate the current list. exports.allbefore = function (source, operator) { var results = prepare_results(source), index = results.indexOf(operator.operand); - return (index <= 0) ? [] : + return (index < 0) ? [] : (operator.suffix) ? results.slice(0, index + 1) : results.slice(0, index); };