public static Object name ( Context cx , Scriptable scope , String name ) { Scriptable parent = scope . getParentScope ( ) ; if ( parent == null ) { Object result = topScopeName ( cx , scope , name ) ; if ( result == Scriptable . NOT_FOUND ) { throw notFoundError ( scope , name ) ; } return result ; } return nameOrFunction ( cx , scope , parent , name , false ) ; }
Looks up a name in the scope chain and returns its value .