minor simplification...

Signed-off-by: Alex A. Naanou <alex.nanou@gmail.com>
This commit is contained in:
Alex A. Naanou 2019-08-23 17:20:18 +03:00
parent 689297d967
commit f41791c810

View File

@ -1923,7 +1923,7 @@ var BaseBrowserPrototype = {
// .walk(func, options) // .walk(func, options)
// -> res??? // -> res???
// //
// func(elem, i, path, next(..), stop()) // func(elem, i, path, next(..), stop(..))
// -> res??? // -> res???
// //
// //
@ -1963,16 +1963,16 @@ var BaseBrowserPrototype = {
var sections = options.section == '*' ? var sections = options.section == '*' ?
(options.sections (options.sections
|| ['header', 'items', 'footer']) || ['header', 'items', 'footer'])
: options.section : [options.section || 'items'].flat()
// NOTE: we include sections other than 'items' only for the root context... // NOTE: sections other than 'items' are included only for the root context...
sections = (sections instanceof Array sections = (context.root !== this
&& context.root !== this) && sections.includes('items')) ?
&& sections.includes('items') ? ['items']
'items' : sections
: (sections || 'items')
sections = sections instanceof Array ?
sections
: [sections]
// XXX iteration filtering... // XXX iteration filtering...
var iterateNonIterable = options.iterateAll || options.iterateNonIterable var iterateNonIterable = options.iterateAll || options.iterateNonIterable
var iterateCollapsed = options.iterateAll || options.iterateCollapsed var iterateCollapsed = options.iterateAll || options.iterateCollapsed