From ff52adbfea5b7f5db6eb02d8546f8140f084344f Mon Sep 17 00:00:00 2001 From: "Alex A. Naanou" Date: Wed, 28 Jun 2017 03:20:53 +0300 Subject: [PATCH] stupid bug fixed... Signed-off-by: Alex A. Naanou --- features.js | 11 +++++++---- package.json | 2 +- 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/features.js b/features.js index 430f78d..2c3e472 100755 --- a/features.js +++ b/features.js @@ -609,15 +609,18 @@ var FeatureSetProto = { var loaded = Object.keys(features) Object.keys(exclusive) .forEach(function(k){ + var l = exclusive[k].length exclusive[k] = exclusive[k] .map(function(e, i){ return [e, i] }) .sort(function(a, b){ var i = loaded.indexOf(a[0]) var j = loaded.indexOf(b[0]) - return (i >= 0 && j >= 0) ? - i - j - : a[1] - b[1] - }) + // keep the missing at the end... + i = i < 0 ? Infinity : i + j = j < 0 ? Infinity : j + // NOTE: Infinity - Infinity is NaN, so we need + // to guard against it... + return i - j || 0 }) .map(function(e){ return e[0] }) }) // do the actual handling... var conflicts = {} diff --git a/package.json b/package.json index 18a480a..7e4cf35 100755 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "ig-features", - "version": "3.1.8", + "version": "3.1.9", "description": "", "main": "features.js", "scripts": {