src/language/JSUtils.js
function _getFunctionsForFile(fileInfo) {
        var result = new $.Deferred();

        _shouldGetFromCache(fileInfo)
            .done(function (useCache) {
                if (useCache) {
                    // Return cached data. doc property is undefined since we hit the cache.
                    // _getOffsets() will fetch the Document if necessary.
                    result.resolve({/*doc: undefined,*/fileInfo: fileInfo, functions: fileInfo.JSUtils.functions});
                } else {
                    _readFile(fileInfo, result);
                }
            }).fail(function (err) {
                result.reject(err);
            });

        return result.promise();
    }
function _getFunctionsForFile(fileInfo) {
        var result = new $.Deferred();

        _shouldGetFromCache(fileInfo)
            .done(function (useCache) {
                if (useCache) {
                    // Return cached data. doc property is undefined since we hit the cache.
                    // _getOffsets() will fetch the Document if necessary.
                    result.resolve({/*doc: undefined,*/fileInfo: fileInfo, functions: fileInfo.JSUtils.functions});
                } else {
                    _readFile(fileInfo, result);
                }
            }).fail(function (err) {
                result.reject(err);
            });

        return result.promise();
    }
function _getFunctionsForFile ( fileInfo ) { var result = new $ . Deferred ( ) ; _shouldGetFromCache ( fileInfo ) . done ( function ( useCache ) { if ( useCache ) { // Return cached data. doc property is undefined since we hit the cache. // _getOffsets() will fetch the Document if necessary. result . resolve ( { /*doc: undefined,*/ fileInfo : fileInfo , functions : fileInfo . JSUtils . functions } ) ; } else { _readFile ( fileInfo , result ) ; } } ) . fail ( function ( err ) { result . reject ( err ) ; } ) ; return result . promise ( ) ; }
Resolves with a record containing the Document or FileInfo and an Array of all
function names with offsets for the specified file. Results may be cached.
@param {FileInfo} fileInfo
@return {$.Promise} A promise resolved with a document info object that
contains a map of all function names from the document and each function's start offset.
Resolves with a record containing the Document or FileInfo and an Array of all function names with offsets for the specified file . Results may be cached .