@@ -385,7 +385,7 @@ Namespace.prototype.lookup = function lookup(path, filterTypes, parentAlreadyChe
385385 if ( this . parent === null || parentAlreadyChecked )
386386 return null ;
387387 return this . parent . lookup ( path , filterTypes ) ;
388- }
388+ } ;
389389
390390/**
391391 * Internal helper for lookup that handles searching just at this namespace and below along with caching.
@@ -395,29 +395,29 @@ Namespace.prototype.lookup = function lookup(path, filterTypes, parentAlreadyChe
395395 */
396396Namespace . prototype . _lookupImpl = function lookup ( path ) {
397397 var flatPath = path . join ( "." ) ;
398- if ( this . _lookupCache . hasOwnProperty ( flatPath ) ) {
398+ if ( Object . prototype . hasOwnProperty . call ( this . _lookupCache , flatPath ) ) {
399399 return this . _lookupCache [ flatPath ] ;
400- } else {
401- // Test if the first part matches any nested object, and if so, traverse if path contains more
402- var found = this . get ( path [ 0 ] ) ;
403- var exact = null ;
404- if ( found ) {
405- if ( path . length === 1 ) {
406- exact = found ;
407- } else if ( found instanceof Namespace && ( found = found . _lookupImpl ( path . slice ( 1 ) ) ) )
408- exact = found ;
400+ }
409401
410- // Otherwise try each nested namespace
411- } else {
412- for ( var i = 0 ; i < this . nestedArray . length ; ++ i )
413- if ( this . _nestedArray [ i ] instanceof Namespace && ( found = this . _nestedArray [ i ] . _lookupImpl ( path ) ) )
414- exact = found ;
415- }
402+ // Test if the first part matches any nested object, and if so, traverse if path contains more
403+ var found = this . get ( path [ 0 ] ) ;
404+ var exact = null ;
405+ if ( found ) {
406+ if ( path . length === 1 ) {
407+ exact = found ;
408+ } else if ( found instanceof Namespace && ( found = found . _lookupImpl ( path . slice ( 1 ) ) ) )
409+ exact = found ;
416410
417- // Set this even when null, so that when we walk up the tree we can quickly bail on repeated checks back down.
418- this . _lookupCache [ flatPath ] = exact ;
419- return exact ;
411+ // Otherwise try each nested namespace
412+ } else {
413+ for ( var i = 0 ; i < this . nestedArray . length ; ++ i )
414+ if ( this . _nestedArray [ i ] instanceof Namespace && ( found = this . _nestedArray [ i ] . _lookupImpl ( path ) ) )
415+ exact = found ;
420416 }
417+
418+ // Set this even when null, so that when we walk up the tree we can quickly bail on repeated checks back down.
419+ this . _lookupCache [ flatPath ] = exact ;
420+ return exact ;
421421} ;
422422
423423/**
0 commit comments