forked from zhurui/management
1 line
457 KiB
Plaintext
1 line
457 KiB
Plaintext
|
{"version":3,"file":"index.js.map","sources":["src/ast/errors.ts","src/ast/nodes.ts","src/ast/traverse.ts","src/common/location-calculator.ts","src/common/debug.ts","src/script/scope-analyzer.ts","src/script/index.ts","src/template/index.ts","src/html/util/attribute-names.ts","src/html/util/tag-names.ts","src/html/intermediate-tokenizer.ts","src/html/parser.ts","src/html/util/alternative-cr.ts","src/html/util/entities.ts","src/html/util/unicode.ts","src/html/tokenizer.ts","src/external/node-event-generator.ts","src/external/token-store/utils.ts","src/external/token-store/cursors/cursor.ts","src/external/token-store/cursors/backward-token-comment-cursor.ts","src/external/token-store/cursors/backward-token-cursor.ts","src/external/token-store/cursors/decorative-cursor.ts","src/external/token-store/cursors/filter-cursor.ts","src/external/token-store/cursors/forward-token-comment-cursor.ts","src/external/token-store/cursors/forward-token-cursor.ts","src/external/token-store/cursors/limit-cursor.ts","src/external/token-store/cursors/skip-cursor.ts","src/external/token-store/cursors/index.ts","src/external/token-store/cursors/padded-token-cursor.ts","src/external/token-store/index.ts","src/parser-services.ts","src/index.ts"],"sourcesContent":["/**\n * @author Toru Nagashima <https://github.com/mysticatea>\n * @copyright 2017 Toru Nagashima. All rights reserved.\n * See LICENSE file in root directory for full license.\n */\nimport { Location } from \"./locations\"\n\n/**\n * Check whether the given value has acorn style location information.\n * @param x The value to check.\n * @returns `true` if the value has acorn style location information.\n */\nfunction isAcornStyleParseError(x: any): x is {message: string, pos: number, loc: Location} {\n return (\n typeof x.message === \"string\" &&\n typeof x.pos === \"number\" &&\n typeof x.loc === \"object\" &&\n x.loc !== null &&\n typeof x.loc.line === \"number\" &&\n typeof x.loc.column === \"number\"\n )\n}\n\n/**\n * HTML parse errors.\n */\nexport class ParseError extends SyntaxError {\n public code?: ErrorCode\n public index: number\n public lineNumber: number\n public column: number\n\n /**\n * Create new parser error object.\n * @param code The error code. See also: https://html.spec.whatwg.org/multipage/parsing.html#parse-errors\n * @param offset The offset number of this error.\n * @param line The line number of this error.\n * @param column The column number of this error.\n */\n static fromCode(code: ErrorCode, offset: number, line: number, column: number): ParseError {\n return new ParseError(code, code, offset, line, column)\n }\n\n /**\n * Normalize the error object.\n * @param x The error object to normalize.\n */\n static normalize(x: any): ParseError | null {\n if (ParseError.isParseError(x)) {\n return x\n }\n if (isAcornStyleParseError(x)) {\n return new ParseError(\n x.message,\n undefined,\n x.pos,\n x.loc.line,\n x.loc.column\n )\n }\n return null\n }\n\n /**\n * Initialize this ParseError instance.\n * @param message The error message.\n * @param code The error code. See also: https://html.spec.whatwg.org/multipage/parsing.html#parse-errors\n * @param offset The offset number of this error.\n * @param line The line number of this error.\n * @param column The column number of this error.\n */\n constructor(message: string, code: ErrorCode | undefined, offset: number, line: number, column: number) {\n super(message)\n this.code = code\n this.index = offset\n this.lineNumber = line\n this.column = column\n }\n\n /**\n * Type guard for ParseError.\n * @param x The value to check.\n * @returns `true` if the value has `message`, `pos`, `loc` properties.\n */\n static isParseError(x: any): x is ParseError {\n
|