function extractJs(filename, data) {
    var errors = new Errors(new HtmlFile({
        filename: filename,
        source: data
    }));
    var scripts = getScripts(data);
    var sources = [];
    var line = 1;
    var lastHtmlPos = 0;

    scripts.forEach(function(scriptInfo) {
        // fetch script source and normalize it
        var normalized = normalizeSource(scriptInfo.source);

        // add line offset before script
        line += data.substring(lastHtmlPos, scriptInfo.start).split(rLineSplit).length - 1;

        sources.push({
            source: normalized.source,
            offset: normalized.offset,
            line: line
        });

        // save offsets for next fragment
        line += normalized.lineCount - 1;
        lastHtmlPos = scriptInfo.end;
    });

    return {
        sources: sources,
        errors: errors,
        addError: function(error) {
            errors._errorList.push({
                filename: filename,
                rule: error.rule,
                message: error.message,
                line: error.line,
                column: error.column
            });
        }
    };
}
Parse HTML and search for <script> sources. Each script source also normalize
by line offset. Result contains script sources with information about line
offset (that was removed for each line) and lines count before script source.
This information helps restore absolute positions in html file for errors.

@param {String} filename
@param {String} data
@returns {Object[]}