mirror of
https://github.com/flynx/features.js.git
synced 2025-10-29 18:30:11 +00:00
bugfix...
Signed-off-by: Alex A. Naanou <alex.nanou@gmail.com>
This commit is contained in:
parent
6a240ef261
commit
6221f56bd4
32
features.js
32
features.js
@ -330,8 +330,16 @@ var FeatureSetProto = {
|
|||||||
// // ignores tags from .suggested...
|
// // ignores tags from .suggested...
|
||||||
// missing: [ .. ],
|
// missing: [ .. ],
|
||||||
//
|
//
|
||||||
// // XXX
|
// // exclusive feature conflicts...
|
||||||
// conflicts: conflicts,
|
// // This will include the explicitly required conflicting
|
||||||
|
// // exclusive features.
|
||||||
|
// // NOTE: this is not an error, but indicates that the
|
||||||
|
// // system tried to fix the state by disabling all
|
||||||
|
// // but the first feature.
|
||||||
|
// conflicts: {
|
||||||
|
// exclusive-tag: [ feature-tag, .. ],
|
||||||
|
// ..
|
||||||
|
// },
|
||||||
//
|
//
|
||||||
// // detected dependency loops (if .length > 0 sets fatal)...
|
// // detected dependency loops (if .length > 0 sets fatal)...
|
||||||
// loops: [ .. ],
|
// loops: [ .. ],
|
||||||
@ -559,6 +567,7 @@ var FeatureSetProto = {
|
|||||||
: [])
|
: [])
|
||||||
|
|
||||||
// build exclusive groups...
|
// build exclusive groups...
|
||||||
|
// XXX need to sort the values to the same order as given features...
|
||||||
var exclusive = {}
|
var exclusive = {}
|
||||||
var rev_exclusive = {}
|
var rev_exclusive = {}
|
||||||
all
|
all
|
||||||
@ -577,9 +586,26 @@ var FeatureSetProto = {
|
|||||||
//-------------------------------- Exclusive groups/aliases ---
|
//-------------------------------- Exclusive groups/aliases ---
|
||||||
// Handle exclusive feature groups and aliases...
|
// Handle exclusive feature groups and aliases...
|
||||||
//
|
//
|
||||||
|
// pre-sort exclusive feature by their occurrence in dependency
|
||||||
|
// tree...
|
||||||
|
// XXX is this the correct approach???
|
||||||
|
var loaded = Object.keys(features)
|
||||||
|
Object.keys(exclusive)
|
||||||
|
.forEach(function(k){
|
||||||
|
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]
|
||||||
|
})
|
||||||
|
.map(function(e){ return e[0] }) })
|
||||||
|
// do the actual handling...
|
||||||
var conflicts = {}
|
var conflicts = {}
|
||||||
var done = []
|
var done = []
|
||||||
Object.keys(features)
|
loaded
|
||||||
.forEach(function(f){
|
.forEach(function(f){
|
||||||
// alias...
|
// alias...
|
||||||
while(f in exclusive && done.indexOf(f) < 0){
|
while(f in exclusive && done.indexOf(f) < 0){
|
||||||
|
|||||||
@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "ig-features",
|
"name": "ig-features",
|
||||||
"version": "3.1.3",
|
"version": "3.1.4",
|
||||||
"description": "",
|
"description": "",
|
||||||
"main": "features.js",
|
"main": "features.js",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user