public static JavaScriptSymbol StartNew(AstNode node, int startLine, int startColumn, int sourceFileId) { if (startLine == int.MaxValue) { throw new ArgumentOutOfRangeException("startLine"); } if (startColumn == int.MaxValue) { throw new ArgumentOutOfRangeException("startColumn"); } return(new JavaScriptSymbol { // destination line/col number are fed to us as zero-based, so add one to get to // the one-based values we desire. Context objects store the source line/col as // one-based already. m_startLine = startLine + 1, m_startColumn = startColumn + 1, m_sourceContext = node != null ? node.Context : null, m_symbolType = node != null?node.GetType().Name : "[UNKNOWN]", m_sourceFileId = sourceFileId, }); }