function analyze(tree, providedOptions) {
    const options = updateDeeply(defaultOptions(), providedOptions);
    const scopeManager = new ScopeManager(options);
    const referencer = new Referencer(options, scopeManager);

    referencer.visit(tree);

    assert(scopeManager.__currentScope === null, "currentScope should be null.");

    return scopeManager;
}
Main interface function. Takes an Espree syntax tree and returns the
analyzed scopes.
@function analyze
@param {espree.Tree} tree Abstract Syntax Tree
@param {Object} providedOptions Options that tailor the scope analysis
@param {boolean} [providedOptions.optimistic=false] the optimistic flag
@param {boolean} [providedOptions.ignoreEval=false] whether to check 'eval()' calls
@param {boolean} [providedOptions.nodejsScope=false] whether the whole
script is executed under node.js environment. When enabled, escope adds
a function scope immediately following the global scope.
@param {boolean} [providedOptions.impliedStrict=false] implied strict mode
(if ecmaVersion >= 5).
@param {string} [providedOptions.sourceType='script'] the source type of the script. one of 'script', 'module', and 'commonjs'
@param {number} [providedOptions.ecmaVersion=5] which ECMAScript version is considered
@param {boolean} [providedOptions.jsx=false] support JSX references
@param {Object} [providedOptions.childVisitorKeys=null] Additional known visitor keys. See [esrecurse](https://github.com/estools/esrecurse)'s the `childVisitorKeys` option.
@param {string} [providedOptions.fallback='iteration'] A kind of the fallback in order to encounter with unknown node. See [esrecurse](https://github.com/estools/esrecurse)'s the `fallback` option.
@returns {ScopeManager} ScopeManager