protected function setNestedOptVal( array &$options, $arg )
    {
        //@codeCoverageIgnoreStart
        $args = func_get_args();
        
        if ( count( $args ) == 2 && is_array( $args[1] ) ) {
            $args = $args[1];
        } else if ( count( $args ) < 3 ) {
            throw new \BadMethodCallException( '\Altamira\JsWriterAbstract::setNestedOptVal requires at least three arguments' );
        } else {
            array_shift( $args );
        }
        
        do {
            $arg = array_shift( $args );
            
            if (! isset( $options[$arg] ) ) {
                $options[$arg] = array();
            }
            $options = &$options[$arg];
            
        } while ( count( $args ) > 2 );
        
        $options[array_shift( $args )] = array_shift( $args );
        
        return $this;
        //@codeCoverageIgnoreEnd
    }