1
0
Fork 0

FieldClassMatcher: Always yield integer indexes

* src/field/FieldClassMatcher.js (match): Cast `vis' to number.
* test/field/FieldClassMatcherTest.js: Remove FIXME and change assertion.
master
Mike Gerwitz 2018-06-12 15:11:24 -04:00
parent 6d6e80aac7
commit 5164c9dcbb
2 changed files with 2 additions and 3 deletions

View File

@ -102,7 +102,7 @@ module.exports = Class( 'FieldClassMatcher',
// default to visible; note that, if we've encountered any
// "all index" situations (scalars), then we must only be
// true if the scalar value was true
vis[ i ] = (
vis[ i ] = +(
( !hasall || all )
&& ( ( vis[ i ] === undefined )
? 1

View File

@ -260,8 +260,7 @@ describe( 'FieldClassMatcher', () =>
foo: {
all: false,
any: false,
// FIXME: should be [ 0, 0 ]
indexes: [ false, false ],
indexes: [ 0, 0 ],
},
},
},