public final S getClosestContainerScope ( ) { S scope = getClosestHoistScope ( ) ; if ( scope . isBlockScope ( ) ) { scope = scope . getParent ( ) ; checkState ( ! scope . isBlockScope ( ) ) ; } return scope ; }
Returns the closest container scope . This is equivalent to what the current scope would have been for non - ES6 scope creators and is thus useful for migrating code to use block scopes .