function SourceCode(text,ast){validate(ast);/**
     * The flag to indicate that the source code has Unicode BOM.
     * @type boolean
     */this.hasBOM=text.charCodeAt(0)===0xFEFF;/**
     * The original text source code.
     * BOM was stripped from this text.
     * @type string
     */this.text=this.hasBOM?text.slice(1):text;/**
     * The parsed AST for the source code.
     * @type ASTNode
     */this.ast=ast;/**
     * The source code split into lines according to ECMA-262 specification.
     * This is done to avoid each rule needing to do so separately.
     * @type string[]
     */this.lines=[];this.lineStartIndices=[0];var lineEndingPattern=astUtils.createGlobalLinebreakMatcher();var match=void 0;/*
     * Previously, this was implemented using a regex that
     * matched a sequence of non-linebreak characters followed by a
     * linebreak, then adding the lengths of the matches. However,
     * this caused a catastrophic backtracking issue when the end
     * of a file contained a large number of non-newline characters.
     * To avoid this, the current implementation just matches newlines
     * and uses match.index to get the correct line start indices.
     */while(match=lineEndingPattern.exec(this.text)){this.lines.push(this.text.slice(this.lineStartIndices[this.lineStartIndices.length-1],match.index));this.lineStartIndices.push(match.index+match[0].length);}this.lines.push(this.text.slice(this.lineStartIndices[this.lineStartIndices.length-1]));this.tokensAndComments=sortedMerge(ast.tokens,ast.comments);// create token store methods
var tokenStore=new TokenStore(ast.tokens,ast.comments);var _iteratorNormalCompletion=true;var _didIteratorError=false;var _iteratorError=undefined;try{for(var _iterator=(0,_getIterator5.default)(TokenStore.PUBLIC_METHODS),_step;!(_iteratorNormalCompletion=(_step=_iterator.next()).done);_iteratorNormalCompletion=true){var methodName=_step.value;this[methodName]=tokenStore[methodName].bind(tokenStore);}// don't allow modification of this object
}catch(err){_didIteratorError=true;_iteratorError=err;}finally{try{if(!_iteratorNormalCompletion&&_iterator.return){_iterator.return();}}finally{if(_didIteratorError){throw _iteratorError;}}}(0,_freeze2.default)(this);(0,_freeze2.default)(this.lines);}
Represents parsed source code.
@param {string} text - The source code text.
@param {ASTNode} ast - The Program node of the AST representing the code. This AST should be created from the text that BOM was stripped.
@constructor