public static Scriptable getTopLevelScope ( Scriptable obj ) { for ( ; ; ) { Scriptable parent = obj . getParentScope ( ) ; if ( parent == null ) { return obj ; } obj = parent ; } }
Get the global scope .