notes and cleanup, still buggy...

Signed-off-by: Alex A. Naanou <alex.nanou@gmail.com>
This commit is contained in:
Alex A. Naanou 2019-03-16 02:57:23 +03:00
parent 292ba4bf2e
commit 5543233e56
2 changed files with 11 additions and 7 deletions

View File

@ -113,7 +113,7 @@ requirejs([
//make('---') //make('---')
// XXX not yet visible... // XXX not yet visible...
//make('...') //make('...')
make('e') //make('e')
// embeded browser... // embeded browser...
make(browser.Browser(function(make){ make(browser.Browser(function(make){
make(1) make(1)
@ -139,6 +139,7 @@ requirejs([
make('b') make('b')
})) }))
make('bbb') make('bbb')
make('bbb')
})) }))
}), { }), {
//collapsed: true, //collapsed: true,

View File

@ -736,7 +736,7 @@ var BaseBrowserPrototype = {
// XXX add literal item support (???) // XXX add literal item support (???)
// XXX do not get .subtree elements of a .collapsed item... // XXX do not get .subtree elements of a .collapsed item...
// XXX skip .noniterable items... // XXX skip .noniterable items...
get: function(key, _){ get: function(key, options){
key = key == null ? 0 : key key = key == null ? 0 : key
// index... // index...
@ -758,6 +758,7 @@ var BaseBrowserPrototype = {
do { do {
var x = key - offset + nested var x = key - offset + nested
// direct match... // direct match...
// XXX skip .noniterable...
if(sublists.length == 0 || x < sublists[0][1]){ if(sublists.length == 0 || x < sublists[0][1]){
return items[x] return items[x]
} }
@ -768,14 +769,15 @@ var BaseBrowserPrototype = {
// inlined... // inlined...
if(sublist.value instanceof Browser){ if(sublist.value instanceof Browser){
var res = sublist.value.get(x - i, true) var res = sublist.value.get(x - i, options)
// nested... // nested...
// XXX support .collapsed...
} else { } else {
var res = x - i == 0 ? var res = x - i == 0 ?
sublist sublist
: sublist.sublist instanceof Browser ? : sublist.sublist instanceof Browser ?
sublist.sublist.get(x - i - 1, true) sublist.sublist.get(x - i - 1, options)
: sublist.sublist[x - i - 1] : sublist.sublist[x - i - 1]
// account for the header... // account for the header...
offset += 1 offset += 1
@ -787,9 +789,10 @@ var BaseBrowserPrototype = {
offset += (sublist.sublist || sublist.value).length offset += (sublist.sublist || sublist.value).length
} while(x >= items.length) // NOTE: we do not need an explicit exit here as the first
// test will bail us out as soon as sublists are
return undefined // depleted...
} while(true)
// XXX this needs to return as soon as we find an item and // XXX this needs to return as soon as we find an item and