// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html
-exports[`compiler: parse > Errors > ABRUPT_CLOSING_OF_EMPTY_COMMENT > <template><!--></template> 1`] = `
-{
- "cached": 0,
- "children": [
- {
- "children": [
- {
- "content": "",
- "loc": {
- "end": {
- "column": 16,
- "line": 1,
- "offset": 15,
- },
- "source": "<!-->",
- "start": {
- "column": 11,
- "line": 1,
- "offset": 10,
- },
- },
- "type": 3,
- },
- ],
- "codegenNode": undefined,
- "isSelfClosing": false,
- "loc": {
- "end": {
- "column": 27,
- "line": 1,
- "offset": 26,
- },
- "source": "<template><!--></template>",
- "start": {
- "column": 1,
- "line": 1,
- "offset": 0,
- },
- },
- "ns": 0,
- "props": [],
- "tag": "template",
- "tagType": 0,
- "type": 1,
- },
- ],
- "codegenNode": undefined,
- "components": [],
- "directives": [],
- "helpers": Set {},
- "hoists": [],
- "imports": [],
- "loc": {
- "end": {
- "column": 27,
- "line": 1,
- "offset": 26,
- },
- "source": "<template><!--></template>",
- "start": {
- "column": 1,
- "line": 1,
- "offset": 0,
- },
- },
- "temps": 0,
- "type": 0,
-}
-`;
-
-exports[`compiler: parse > Errors > ABRUPT_CLOSING_OF_EMPTY_COMMENT > <template><!---></template> 1`] = `
-{
- "cached": 0,
- "children": [
- {
- "children": [
- {
- "content": "",
- "loc": {
- "end": {
- "column": 17,
- "line": 1,
- "offset": 16,
- },
- "source": "<!--->",
- "start": {
- "column": 11,
- "line": 1,
- "offset": 10,
- },
- },
- "type": 3,
- },
- ],
- "codegenNode": undefined,
- "isSelfClosing": false,
- "loc": {
- "end": {
- "column": 28,
- "line": 1,
- "offset": 27,
- },
- "source": "<template><!---></template>",
- "start": {
- "column": 1,
- "line": 1,
- "offset": 0,
- },
- },
- "ns": 0,
- "props": [],
- "tag": "template",
- "tagType": 0,
- "type": 1,
- },
- ],
- "codegenNode": undefined,
- "components": [],
- "directives": [],
- "helpers": Set {},
- "hoists": [],
- "imports": [],
- "loc": {
- "end": {
- "column": 28,
- "line": 1,
- "offset": 27,
- },
- "source": "<template><!---></template>",
- "start": {
- "column": 1,
- "line": 1,
- "offset": 0,
- },
- },
- "temps": 0,
- "type": 0,
-}
-`;
-
-exports[`compiler: parse > Errors > ABRUPT_CLOSING_OF_EMPTY_COMMENT > <template><!----></template> 1`] = `
-{
- "cached": 0,
- "children": [
- {
- "children": [
- {
- "content": "",
- "loc": {
- "end": {
- "column": 18,
- "line": 1,
- "offset": 17,
- },
- "source": "<!---->",
- "start": {
- "column": 11,
- "line": 1,
- "offset": 10,
- },
- },
- "type": 3,
- },
- ],
- "codegenNode": undefined,
- "isSelfClosing": false,
- "loc": {
- "end": {
- "column": 29,
- "line": 1,
- "offset": 28,
- },
- "source": "<template><!----></template>",
- "start": {
- "column": 1,
- "line": 1,
- "offset": 0,
- },
- },
- "ns": 0,
- "props": [],
- "tag": "template",
- "tagType": 0,
- "type": 1,
- },
- ],
- "codegenNode": undefined,
- "components": [],
- "directives": [],
- "helpers": Set {},
- "hoists": [],
- "imports": [],
- "loc": {
- "end": {
- "column": 29,
- "line": 1,
- "offset": 28,
- },
- "source": "<template><!----></template>",
- "start": {
- "column": 1,
- "line": 1,
- "offset": 0,
- },
- },
- "temps": 0,
- "type": 0,
-}
-`;
-
-exports[`compiler: parse > Errors > CDATA_IN_HTML_CONTENT > <template><![CDATA[cdata]]></template> 1`] = `
-{
- "cached": 0,
- "children": [
- {
- "children": [
- {
- "content": "[CDATA[cdata]]",
- "loc": {
- "end": {
- "column": 28,
- "line": 1,
- "offset": 27,
- },
- "source": "<![CDATA[cdata]]>",
- "start": {
- "column": 11,
- "line": 1,
- "offset": 10,
- },
- },
- "type": 3,
- },
- ],
- "codegenNode": undefined,
- "isSelfClosing": false,
- "loc": {
- "end": {
- "column": 39,
- "line": 1,
- "offset": 38,
- },
- "source": "<template><![CDATA[cdata]]></template>",
- "start": {
- "column": 1,
- "line": 1,
- "offset": 0,
- },
- },
- "ns": 0,
- "props": [],
- "tag": "template",
- "tagType": 0,
- "type": 1,
- },
- ],
- "codegenNode": undefined,
- "components": [],
- "directives": [],
- "helpers": Set {},
- "hoists": [],
- "imports": [],
- "loc": {
- "end": {
- "column": 39,
- "line": 1,
- "offset": 38,
- },
- "source": "<template><![CDATA[cdata]]></template>",
- "start": {
- "column": 1,
- "line": 1,
- "offset": 0,
- },
- },
- "temps": 0,
- "type": 0,
-}
-`;
-
-exports[`compiler: parse > Errors > CDATA_IN_HTML_CONTENT > <template><svg><![CDATA[cdata]]></svg></template> 1`] = `
-{
- "cached": 0,
- "children": [
- {
- "children": [
- {
- "children": [
- {
- "content": "cdata",
- "loc": {
- "end": {
- "column": 30,
- "line": 1,
- "offset": 29,
- },
- "source": "cdata",
- "start": {
- "column": 25,
- "line": 1,
- "offset": 24,
- },
- },
- "type": 2,
- },
- ],
- "codegenNode": undefined,
- "isSelfClosing": false,
- "loc": {
- "end": {
- "column": 39,
- "line": 1,
- "offset": 38,
- },
- "source": "<svg><![CDATA[cdata]]></svg>",
- "start": {
- "column": 11,
- "line": 1,
- "offset": 10,
- },
- },
- "ns": 1,
- "props": [],
- "tag": "svg",
- "tagType": 0,
- "type": 1,
- },
- ],
- "codegenNode": undefined,
- "isSelfClosing": false,
- "loc": {
- "end": {
- "column": 50,
- "line": 1,
- "offset": 49,
- },
- "source": "<template><svg><![CDATA[cdata]]></svg></template>",
- "start": {
- "column": 1,
- "line": 1,
- "offset": 0,
- },
- },
- "ns": 0,
- "props": [],
- "tag": "template",
- "tagType": 0,
- "type": 1,
- },
- ],
- "codegenNode": undefined,
- "components": [],
- "directives": [],
- "helpers": Set {},
- "hoists": [],
- "imports": [],
- "loc": {
- "end": {
- "column": 50,
- "line": 1,
- "offset": 49,
- },
- "source": "<template><svg><![CDATA[cdata]]></svg></template>",
- "start": {
- "column": 1,
- "line": 1,
- "offset": 0,
- },
- },
- "temps": 0,
- "type": 0,
-}
-`;
-
-exports[`compiler: parse > Errors > DUPLICATE_ATTRIBUTE > <template><div id="" id=""></div></template> 1`] = `
-{
- "cached": 0,
- "children": [
- {
- "children": [
- {
- "children": [],
- "codegenNode": undefined,
- "isSelfClosing": false,
- "loc": {
- "end": {
- "column": 34,
- "line": 1,
- "offset": 33,
- },
- "source": "<div id=\\"\\" id=\\"\\"></div>",
- "start": {
- "column": 11,
- "line": 1,
- "offset": 10,
- },
- },
- "ns": 0,
- "props": [
- {
- "loc": {
- "end": {
- "column": 21,
- "line": 1,
- "offset": 20,
- },
- "source": "id=\\"\\"",
- "start": {
- "column": 16,
- "line": 1,
- "offset": 15,
- },
- },
- "name": "id",
- "type": 6,
- "value": {
- "content": "",
- "loc": {
- "end": {
- "column": 21,
- "line": 1,
- "offset": 20,
- },
- "source": "\\"\\"",
- "start": {
- "column": 19,
- "line": 1,
- "offset": 18,
- },
- },
- "type": 2,
- },
- },
- {
- "loc": {
- "end": {
- "column": 27,
- "line": 1,
- "offset": 26,
- },
- "source": "id=\\"\\"",
- "start": {
- "column": 22,
- "line": 1,
- "offset": 21,
- },
- },
- "name": "id",
- "type": 6,
- "value": {
- "content": "",
- "loc": {
- "end": {
- "column": 27,
- "line": 1,
- "offset": 26,
- },
- "source": "\\"\\"",
- "start": {
- "column": 25,
- "line": 1,
- "offset": 24,
- },
- },
- "type": 2,
- },
- },
- ],
- "tag": "div",
- "tagType": 0,
- "type": 1,
- },
- ],
- "codegenNode": undefined,
- "isSelfClosing": false,
- "loc": {
- "end": {
- "column": 45,
- "line": 1,
- "offset": 44,
- },
- "source": "<template><div id=\\"\\" id=\\"\\"></div></template>",
- "start": {
- "column": 1,
- "line": 1,
- "offset": 0,
- },
- },
- "ns": 0,
- "props": [],
- "tag": "template",
- "tagType": 0,
- "type": 1,
- },
- ],
- "codegenNode": undefined,
- "components": [],
- "directives": [],
- "helpers": Set {},
- "hoists": [],
- "imports": [],
- "loc": {
- "end": {
- "column": 45,
- "line": 1,
- "offset": 44,
- },
- "source": "<template><div id=\\"\\" id=\\"\\"></div></template>",
- "start": {
- "column": 1,
- "line": 1,
- "offset": 0,
- },
- },
- "temps": 0,
- "type": 0,
-}
-`;
-
-exports[`compiler: parse > Errors > END_TAG_WITH_ATTRIBUTES > <template><div></div id=""></template> 1`] = `
-{
- "cached": 0,
- "children": [
- {
- "children": [
- {
- "children": [],
- "codegenNode": undefined,
- "isSelfClosing": false,
- "loc": {
- "end": {
- "column": 28,
- "line": 1,
- "offset": 27,
- },
- "source": "<div></div id=\\"\\">",
- "start": {
- "column": 11,
- "line": 1,
- "offset": 10,
- },
- },
- "ns": 0,
- "props": [],
- "tag": "div",
- "tagType": 0,
- "type": 1,
- },
- ],
- "codegenNode": undefined,
- "isSelfClosing": false,
- "loc": {
- "end": {
- "column": 39,
- "line": 1,
- "offset": 38,
- },
- "source": "<template><div></div id=\\"\\"></template>",
- "start": {
- "column": 1,
- "line": 1,
- "offset": 0,
- },
- },
- "ns": 0,
- "props": [],
- "tag": "template",
- "tagType": 0,
- "type": 1,
- },
- ],
- "codegenNode": undefined,
- "components": [],
- "directives": [],
- "helpers": Set {},
- "hoists": [],
- "imports": [],
- "loc": {
- "end": {
- "column": 39,
- "line": 1,
- "offset": 38,
- },
- "source": "<template><div></div id=\\"\\"></template>",
- "start": {
- "column": 1,
- "line": 1,
- "offset": 0,
- },
- },
- "temps": 0,
- "type": 0,
-}
-`;
-
-exports[`compiler: parse > Errors > END_TAG_WITH_TRAILING_SOLIDUS > <template><div></div/></template> 1`] = `
-{
- "cached": 0,
- "children": [
- {
- "children": [
- {
- "children": [],
- "codegenNode": undefined,
- "isSelfClosing": false,
- "loc": {
- "end": {
- "column": 23,
- "line": 1,
- "offset": 22,
- },
- "source": "<div></div/>",
- "start": {
- "column": 11,
- "line": 1,
- "offset": 10,
- },
- },
- "ns": 0,
- "props": [],
- "tag": "div",
- "tagType": 0,
- "type": 1,
- },
- ],
- "codegenNode": undefined,
- "isSelfClosing": false,
- "loc": {
- "end": {
- "column": 34,
- "line": 1,
- "offset": 33,
- },
- "source": "<template><div></div/></template>",
- "start": {
- "column": 1,
- "line": 1,
- "offset": 0,
- },
- },
- "ns": 0,
- "props": [],
- "tag": "template",
- "tagType": 0,
- "type": 1,
- },
- ],
- "codegenNode": undefined,
- "components": [],
- "directives": [],
- "helpers": Set {},
- "hoists": [],
- "imports": [],
- "loc": {
- "end": {
- "column": 34,
- "line": 1,
- "offset": 33,
- },
- "source": "<template><div></div/></template>",
- "start": {
- "column": 1,
- "line": 1,
- "offset": 0,
- },
- },
- "temps": 0,
- "type": 0,
-}
-`;
-
-exports[`compiler: parse > Errors > EOF_BEFORE_TAG_NAME > <template>< 1`] = `
-{
- "cached": 0,
- "children": [
- {
- "children": [
- {
- "content": "<",
- "loc": {
- "end": {
- "column": 12,
- "line": 1,
- "offset": 11,
- },
- "source": "<",
- "start": {
- "column": 11,
- "line": 1,
- "offset": 10,
- },
- },
- "type": 2,
- },
- ],
- "codegenNode": undefined,
- "isSelfClosing": false,
- "loc": {
- "end": {
- "column": 12,
- "line": 1,
- "offset": 11,
- },
- "source": "<template><",
- "start": {
- "column": 1,
- "line": 1,
- "offset": 0,
- },
- },
- "ns": 0,
- "props": [],
- "tag": "template",
- "tagType": 0,
- "type": 1,
- },
- ],
- "codegenNode": undefined,
- "components": [],
- "directives": [],
- "helpers": Set {},
- "hoists": [],
- "imports": [],
- "loc": {
- "end": {
- "column": 12,
- "line": 1,
- "offset": 11,
- },
- "source": "<template><",
- "start": {
- "column": 1,
- "line": 1,
- "offset": 0,
- },
- },
- "temps": 0,
- "type": 0,
-}
-`;
-
-exports[`compiler: parse > Errors > EOF_BEFORE_TAG_NAME > <template></ 1`] = `
-{
- "cached": 0,
- "children": [
- {
- "children": [
- {
- "content": "</",
- "loc": {
- "end": {
- "column": 13,
- "line": 1,
- "offset": 12,
- },
- "source": "</",
- "start": {
- "column": 11,
- "line": 1,
- "offset": 10,
- },
- },
- "type": 2,
- },
- ],
- "codegenNode": undefined,
- "isSelfClosing": false,
- "loc": {
- "end": {
- "column": 13,
- "line": 1,
- "offset": 12,
- },
- "source": "<template></",
- "start": {
- "column": 1,
- "line": 1,
- "offset": 0,
- },
- },
- "ns": 0,
- "props": [],
- "tag": "template",
- "tagType": 0,
- "type": 1,
- },
- ],
- "codegenNode": undefined,
- "components": [],
- "directives": [],
- "helpers": Set {},
- "hoists": [],
- "imports": [],
- "loc": {
- "end": {
- "column": 13,
- "line": 1,
- "offset": 12,
- },
- "source": "<template></",
- "start": {
- "column": 1,
- "line": 1,
- "offset": 0,
- },
- },
- "temps": 0,
- "type": 0,
-}
-`;
-
-exports[`compiler: parse > Errors > EOF_IN_CDATA > <template><svg><![CDATA[ 1`] = `
-{
- "cached": 0,
- "children": [
- {
- "children": [
- {
- "children": [],
- "codegenNode": undefined,
- "isSelfClosing": false,
- "loc": {
- "end": {
- "column": 25,
- "line": 1,
- "offset": 24,
- },
- "source": "<svg><![CDATA[",
- "start": {
- "column": 11,
- "line": 1,
- "offset": 10,
- },
- },
- "ns": 1,
- "props": [],
- "tag": "svg",
- "tagType": 0,
- "type": 1,
- },
- ],
- "codegenNode": undefined,
- "isSelfClosing": false,
- "loc": {
- "end": {
- "column": 25,
- "line": 1,
- "offset": 24,
- },
- "source": "<template><svg><![CDATA[",
- "start": {
- "column": 1,
- "line": 1,
- "offset": 0,
- },
- },
- "ns": 0,
- "props": [],
- "tag": "template",
- "tagType": 0,
- "type": 1,
- },
- ],
- "codegenNode": undefined,
- "components": [],
- "directives": [],
- "helpers": Set {},
- "hoists": [],
- "imports": [],
- "loc": {
- "end": {
- "column": 25,
- "line": 1,
- "offset": 24,
- },
- "source": "<template><svg><![CDATA[",
- "start": {
- "column": 1,
- "line": 1,
- "offset": 0,
- },
- },
- "temps": 0,
- "type": 0,
-}
-`;
-
-exports[`compiler: parse > Errors > EOF_IN_CDATA > <template><svg><![CDATA[cdata 1`] = `
-{
- "cached": 0,
- "children": [
- {
- "children": [
- {
- "children": [
- {
- "content": "cdata",
- "loc": {
- "end": {
- "column": 30,
- "line": 1,
- "offset": 29,
- },
- "source": "cdata",
- "start": {
- "column": 25,
- "line": 1,
- "offset": 24,
- },
- },
- "type": 2,
- },
- ],
- "codegenNode": undefined,
- "isSelfClosing": false,
- "loc": {
- "end": {
- "column": 30,
- "line": 1,
- "offset": 29,
- },
- "source": "<svg><![CDATA[cdata",
- "start": {
- "column": 11,
- "line": 1,
- "offset": 10,
- },
- },
- "ns": 1,
- "props": [],
- "tag": "svg",
- "tagType": 0,
- "type": 1,
- },
- ],
- "codegenNode": undefined,
- "isSelfClosing": false,
- "loc": {
- "end": {
- "column": 30,
- "line": 1,
- "offset": 29,
- },
- "source": "<template><svg><![CDATA[cdata",
- "start": {
- "column": 1,
- "line": 1,
- "offset": 0,
- },
- },
- "ns": 0,
- "props": [],
- "tag": "template",
- "tagType": 0,
- "type": 1,
- },
- ],
- "codegenNode": undefined,
- "components": [],
- "directives": [],
- "helpers": Set {},
- "hoists": [],
- "imports": [],
- "loc": {
- "end": {
- "column": 30,
- "line": 1,
- "offset": 29,
- },
- "source": "<template><svg><![CDATA[cdata",
- "start": {
- "column": 1,
- "line": 1,
- "offset": 0,
- },
- },
- "temps": 0,
- "type": 0,
-}
-`;
-
-exports[`compiler: parse > Errors > EOF_IN_COMMENT > <template><! 1`] = `
-{
- "cached": 0,
- "children": [
- {
- "children": [
- {
- "content": "",
- "loc": {
- "end": {
- "column": 13,
- "line": 1,
- "offset": 12,
- },
- "source": "<!",
- "start": {
- "column": 11,
- "line": 1,
- "offset": 10,
- },
- },
- "type": 3,
- },
- ],
- "codegenNode": undefined,
- "isSelfClosing": false,
- "loc": {
- "end": {
- "column": 13,
- "line": 1,
- "offset": 12,
- },
- "source": "<template><!",
- "start": {
- "column": 1,
- "line": 1,
- "offset": 0,
- },
- },
- "ns": 0,
- "props": [],
- "tag": "template",
- "tagType": 0,
- "type": 1,
- },
- ],
- "codegenNode": undefined,
- "components": [],
- "directives": [],
- "helpers": Set {},
- "hoists": [],
- "imports": [],
- "loc": {
- "end": {
- "column": 13,
- "line": 1,
- "offset": 12,
- },
- "source": "<template><!",
- "start": {
- "column": 1,
- "line": 1,
- "offset": 0,
- },
- },
- "temps": 0,
- "type": 0,
-}
-`;
-
-exports[`compiler: parse > Errors > EOF_IN_COMMENT > <template><!- 1`] = `
-{
- "cached": 0,
- "children": [
- {
- "children": [
- {
- "content": "-",
- "loc": {
- "end": {
- "column": 14,
- "line": 1,
- "offset": 13,
- },
- "source": "<!-",
- "start": {
- "column": 11,
- "line": 1,
- "offset": 10,
- },
- },
- "type": 3,
- },
- ],
- "codegenNode": undefined,
- "isSelfClosing": false,
- "loc": {
- "end": {
- "column": 14,
- "line": 1,
- "offset": 13,
- },
- "source": "<template><!-",
- "start": {
- "column": 1,
- "line": 1,
- "offset": 0,
- },
- },
- "ns": 0,
- "props": [],
- "tag": "template",
- "tagType": 0,
- "type": 1,
- },
- ],
- "codegenNode": undefined,
- "components": [],
- "directives": [],
- "helpers": Set {},
- "hoists": [],
- "imports": [],
- "loc": {
- "end": {
- "column": 14,
- "line": 1,
- "offset": 13,
- },
- "source": "<template><!-",
- "start": {
- "column": 1,
- "line": 1,
- "offset": 0,
- },
- },
- "temps": 0,
- "type": 0,
-}
-`;
-
-exports[`compiler: parse > Errors > EOF_IN_COMMENT > <template><!-- 1`] = `
-{
- "cached": 0,
- "children": [
- {
- "children": [
- {
- "content": "",
- "loc": {
- "end": {
- "column": 15,
- "line": 1,
- "offset": 14,
- },
- "source": "<!--",
- "start": {
- "column": 11,
- "line": 1,
- "offset": 10,
- },
- },
- "type": 3,
- },
- ],
- "codegenNode": undefined,
- "isSelfClosing": false,
- "loc": {
- "end": {
- "column": 15,
- "line": 1,
- "offset": 14,
- },
- "source": "<template><!--",
- "start": {
- "column": 1,
- "line": 1,
- "offset": 0,
- },
- },
- "ns": 0,
- "props": [],
- "tag": "template",
- "tagType": 0,
- "type": 1,
- },
- ],
- "codegenNode": undefined,
- "components": [],
- "directives": [],
- "helpers": Set {},
- "hoists": [],
- "imports": [],
- "loc": {
- "end": {
- "column": 15,
- "line": 1,
- "offset": 14,
- },
- "source": "<template><!--",
- "start": {
- "column": 1,
- "line": 1,
- "offset": 0,
- },
- },
- "temps": 0,
- "type": 0,
-}
-`;
-
-exports[`compiler: parse > Errors > EOF_IN_COMMENT > <template><!--comment 1`] = `
-{
- "cached": 0,
- "children": [
- {
- "children": [
- {
- "content": "comment",
- "loc": {
- "end": {
- "column": 22,
- "line": 1,
- "offset": 21,
- },
- "source": "<!--comment",
- "start": {
- "column": 11,
- "line": 1,
- "offset": 10,
- },
- },
- "type": 3,
- },
- ],
- "codegenNode": undefined,
- "isSelfClosing": false,
- "loc": {
- "end": {
- "column": 22,
- "line": 1,
- "offset": 21,
- },
- "source": "<template><!--comment",
- "start": {
- "column": 1,
- "line": 1,
- "offset": 0,
- },
- },
- "ns": 0,
- "props": [],
- "tag": "template",
- "tagType": 0,
- "type": 1,
- },
- ],
- "codegenNode": undefined,
- "components": [],
- "directives": [],
- "helpers": Set {},
- "hoists": [],
- "imports": [],
- "loc": {
- "end": {
- "column": 22,
- "line": 1,
- "offset": 21,
- },
- "source": "<template><!--comment",
- "start": {
- "column": 1,
- "line": 1,
- "offset": 0,
- },
- },
- "temps": 0,
- "type": 0,
-}
-`;
-
-exports[`compiler: parse > Errors > EOF_IN_COMMENT > <template><!abc 1`] = `
-{
- "cached": 0,
- "children": [
- {
- "children": [
- {
- "content": "abc",
- "loc": {
- "end": {
- "column": 16,
- "line": 1,
- "offset": 15,
- },
- "source": "<!abc",
- "start": {
- "column": 11,
- "line": 1,
- "offset": 10,
- },
- },
- "type": 3,
- },
- ],
- "codegenNode": undefined,
- "isSelfClosing": false,
- "loc": {
- "end": {
- "column": 16,
- "line": 1,
- "offset": 15,
- },
- "source": "<template><!abc",
- "start": {
- "column": 1,
- "line": 1,
- "offset": 0,
- },
- },
- "ns": 0,
- "props": [],
- "tag": "template",
- "tagType": 0,
- "type": 1,
- },
- ],
- "codegenNode": undefined,
- "components": [],
- "directives": [],
- "helpers": Set {},
- "hoists": [],
- "imports": [],
- "loc": {
- "end": {
- "column": 16,
- "line": 1,
- "offset": 15,
- },
- "source": "<template><!abc",
- "start": {
- "column": 1,
- "line": 1,
- "offset": 0,
- },
- },
- "temps": 0,
- "type": 0,
-}
-`;
-
-exports[`compiler: parse > Errors > EOF_IN_SCRIPT_HTML_COMMENT_LIKE_TEXT > <script><!--console.log('hello') 1`] = `
-{
- "cached": 0,
- "children": [
- {
- "children": [
- {
- "content": "<!--console.log('hello')",
- "loc": {
- "end": {
- "column": 33,
- "line": 1,
- "offset": 32,
- },
- "source": "<!--console.log('hello')",
- "start": {
- "column": 9,
- "line": 1,
- "offset": 8,
- },
- },
- "type": 2,
- },
- ],
- "codegenNode": undefined,
- "isSelfClosing": false,
- "loc": {
- "end": {
- "column": 33,
- "line": 1,
- "offset": 32,
- },
- "source": "<script><!--console.log('hello')",
- "start": {
- "column": 1,
- "line": 1,
- "offset": 0,
- },
- },
- "ns": 0,
- "props": [],
- "tag": "script",
- "tagType": 0,
- "type": 1,
- },
- ],
- "codegenNode": undefined,
- "components": [],
- "directives": [],
- "helpers": Set {},
- "hoists": [],
- "imports": [],
- "loc": {
- "end": {
- "column": 33,
- "line": 1,
- "offset": 32,
- },
- "source": "<script><!--console.log('hello')",
- "start": {
- "column": 1,
- "line": 1,
- "offset": 0,
- },
- },
- "temps": 0,
- "type": 0,
-}
-`;
-
-exports[`compiler: parse > Errors > EOF_IN_SCRIPT_HTML_COMMENT_LIKE_TEXT > <script>console.log('hello') 1`] = `
-{
- "cached": 0,
- "children": [
- {
- "children": [
- {
- "content": "console.log('hello')",
- "loc": {
- "end": {
- "column": 29,
- "line": 1,
- "offset": 28,
- },
- "source": "console.log('hello')",
- "start": {
- "column": 9,
- "line": 1,
- "offset": 8,
- },
- },
- "type": 2,
- },
- ],
- "codegenNode": undefined,
- "isSelfClosing": false,
- "loc": {
- "end": {
- "column": 29,
- "line": 1,
- "offset": 28,
- },
- "source": "<script>console.log('hello')",
- "start": {
- "column": 1,
- "line": 1,
- "offset": 0,
- },
- },
- "ns": 0,
- "props": [],
- "tag": "script",
- "tagType": 0,
- "type": 1,
- },
- ],
- "codegenNode": undefined,
- "components": [],
- "directives": [],
- "helpers": Set {},
- "hoists": [],
- "imports": [],
- "loc": {
- "end": {
- "column": 29,
- "line": 1,
- "offset": 28,
- },
- "source": "<script>console.log('hello')",
- "start": {
- "column": 1,
- "line": 1,
- "offset": 0,
- },
- },
- "temps": 0,
- "type": 0,
-}
-`;
-
-exports[`compiler: parse > Errors > EOF_IN_TAG > <div></div 1`] = `
-{
- "cached": 0,
- "children": [
- {
- "children": [],
- "codegenNode": undefined,
- "isSelfClosing": false,
- "loc": {
- "end": {
- "column": 11,
- "line": 1,
- "offset": 10,
- },
- "source": "<div></div",
- "start": {
- "column": 1,
- "line": 1,
- "offset": 0,
- },
- },
- "ns": 0,
- "props": [],
- "tag": "div",
- "tagType": 0,
- "type": 1,
- },
- ],
- "codegenNode": undefined,
- "components": [],
- "directives": [],
- "helpers": Set {},
- "hoists": [],
- "imports": [],
- "loc": {
- "end": {
- "column": 11,
- "line": 1,
- "offset": 10,
- },
- "source": "<div></div",
- "start": {
- "column": 1,
- "line": 1,
- "offset": 0,
- },
- },
- "temps": 0,
- "type": 0,
-}
-`;
-
-exports[`compiler: parse > Errors > EOF_IN_TAG > <template><div 1`] = `
-{
- "cached": 0,
- "children": [
- {
- "children": [
- {
- "children": [],
- "codegenNode": undefined,
- "isSelfClosing": false,
- "loc": {
- "end": {
- "column": 16,
- "line": 1,
- "offset": 15,
- },
- "source": "<div ",
- "start": {
- "column": 11,
- "line": 1,
- "offset": 10,
- },
- },
- "ns": 0,
- "props": [],
- "tag": "div",
- "tagType": 0,
- "type": 1,
- },
- ],
- "codegenNode": undefined,
- "isSelfClosing": false,
- "loc": {
- "end": {
- "column": 16,
- "line": 1,
- "offset": 15,
- },
- "source": "<template><div ",
- "start": {
- "column": 1,
- "line": 1,
- "offset": 0,
- },
- },
- "ns": 0,
- "props": [],
- "tag": "template",
- "tagType": 0,
- "type": 1,
- },
- ],
- "codegenNode": undefined,
- "components": [],
- "directives": [],
- "helpers": Set {},
- "hoists": [],
- "imports": [],
- "loc": {
- "end": {
- "column": 16,
- "line": 1,
- "offset": 15,
- },
- "source": "<template><div ",
- "start": {
- "column": 1,
- "line": 1,
- "offset": 0,
- },
- },
- "temps": 0,
- "type": 0,
-}
-`;
-
-exports[`compiler: parse > Errors > EOF_IN_TAG > <template><div 1`] = `
-{
- "cached": 0,
- "children": [
- {
- "children": [
- {
- "children": [],
- "codegenNode": undefined,
- "isSelfClosing": false,
- "loc": {
- "end": {
- "column": 15,
- "line": 1,
- "offset": 14,
- },
- "source": "<div",
- "start": {
- "column": 11,
- "line": 1,
- "offset": 10,
- },
- },
- "ns": 0,
- "props": [],
- "tag": "div",
- "tagType": 0,
- "type": 1,
- },
- ],
- "codegenNode": undefined,
- "isSelfClosing": false,
- "loc": {
- "end": {
- "column": 15,
- "line": 1,
- "offset": 14,
- },
- "source": "<template><div",
- "start": {
- "column": 1,
- "line": 1,
- "offset": 0,
- },
- },
- "ns": 0,
- "props": [],
- "tag": "template",
- "tagType": 0,
- "type": 1,
- },
- ],
- "codegenNode": undefined,
- "components": [],
- "directives": [],
- "helpers": Set {},
- "hoists": [],
- "imports": [],
- "loc": {
- "end": {
- "column": 15,
- "line": 1,
- "offset": 14,
- },
- "source": "<template><div",
- "start": {
- "column": 1,
- "line": 1,
- "offset": 0,
- },
- },
- "temps": 0,
- "type": 0,
-}
-`;
-
-exports[`compiler: parse > Errors > EOF_IN_TAG > <template><div id 1`] = `
-{
- "cached": 0,
- "children": [
- {
- "children": [
- {
- "children": [],
- "codegenNode": undefined,
- "isSelfClosing": false,
- "loc": {
- "end": {
- "column": 19,
- "line": 1,
- "offset": 18,
- },
- "source": "<div id ",
- "start": {
- "column": 11,
- "line": 1,
- "offset": 10,
- },
- },
- "ns": 0,
- "props": [
- {
- "loc": {
- "end": {
- "column": 18,
- "line": 1,
- "offset": 17,
- },
- "source": "id",
- "start": {
- "column": 16,
- "line": 1,
- "offset": 15,
- },
- },
- "name": "id",
- "type": 6,
- "value": undefined,
- },
- ],
- "tag": "div",
- "tagType": 0,
- "type": 1,
- },
- ],
- "codegenNode": undefined,
- "isSelfClosing": false,
- "loc": {
- "end": {
- "column": 19,
- "line": 1,
- "offset": 18,
- },
- "source": "<template><div id ",
- "start": {
- "column": 1,
- "line": 1,
- "offset": 0,
- },
- },
- "ns": 0,
- "props": [],
- "tag": "template",
- "tagType": 0,
- "type": 1,
- },
- ],
- "codegenNode": undefined,
- "components": [],
- "directives": [],
- "helpers": Set {},
- "hoists": [],
- "imports": [],
- "loc": {
- "end": {
- "column": 19,
- "line": 1,
- "offset": 18,
- },
- "source": "<template><div id ",
- "start": {
- "column": 1,
- "line": 1,
- "offset": 0,
- },
- },
- "temps": 0,
- "type": 0,
-}
-`;
-
-exports[`compiler: parse > Errors > EOF_IN_TAG > <template><div id = 1`] = `
-{
- "cached": 0,
- "children": [
- {
- "children": [
- {
- "children": [],
- "codegenNode": undefined,
- "isSelfClosing": false,
- "loc": {
- "end": {
- "column": 20,
- "line": 1,
- "offset": 19,
- },
- "source": "<div id =",
- "start": {
- "column": 11,
- "line": 1,
- "offset": 10,
- },
- },
- "ns": 0,
- "props": [
- {
- "loc": {
- "end": {
- "column": 20,
- "line": 1,
- "offset": 19,
- },
- "source": "id =",
- "start": {
- "column": 16,
- "line": 1,
- "offset": 15,
- },
- },
- "name": "id",
- "type": 6,
- "value": undefined,
- },
- ],
- "tag": "div",
- "tagType": 0,
- "type": 1,
- },
- ],
- "codegenNode": undefined,
- "isSelfClosing": false,
- "loc": {
- "end": {
- "column": 20,
- "line": 1,
- "offset": 19,
- },
- "source": "<template><div id =",
- "start": {
- "column": 1,
- "line": 1,
- "offset": 0,
- },
- },
- "ns": 0,
- "props": [],
- "tag": "template",
- "tagType": 0,
- "type": 1,
- },
- ],
- "codegenNode": undefined,
- "components": [],
- "directives": [],
- "helpers": Set {},
- "hoists": [],
- "imports": [],
- "loc": {
- "end": {
- "column": 20,
- "line": 1,
- "offset": 19,
- },
- "source": "<template><div id =",
- "start": {
- "column": 1,
- "line": 1,
- "offset": 0,
- },
- },
- "temps": 0,
- "type": 0,
-}
-`;
-
-exports[`compiler: parse > Errors > EOF_IN_TAG > <template><div id 1`] = `
-{
- "cached": 0,
- "children": [
- {
- "children": [
- {
- "children": [],
- "codegenNode": undefined,
- "isSelfClosing": false,
- "loc": {
- "end": {
- "column": 18,
- "line": 1,
- "offset": 17,
- },
- "source": "<div id",
- "start": {
- "column": 11,
- "line": 1,
- "offset": 10,
- },
- },
- "ns": 0,
- "props": [
- {
- "loc": {
- "end": {
- "column": 18,
- "line": 1,
- "offset": 17,
- },
- "source": "id",
- "start": {
- "column": 16,
- "line": 1,
- "offset": 15,
- },
- },
- "name": "id",
- "type": 6,
- "value": undefined,
- },
- ],
- "tag": "div",
- "tagType": 0,
- "type": 1,
- },
- ],
- "codegenNode": undefined,
- "isSelfClosing": false,
- "loc": {
- "end": {
- "column": 18,
- "line": 1,
- "offset": 17,
- },
- "source": "<template><div id",
- "start": {
- "column": 1,
- "line": 1,
- "offset": 0,
- },
- },
- "ns": 0,
- "props": [],
- "tag": "template",
- "tagType": 0,
- "type": 1,
- },
- ],
- "codegenNode": undefined,
- "components": [],
- "directives": [],
- "helpers": Set {},
- "hoists": [],
- "imports": [],
- "loc": {
- "end": {
- "column": 18,
- "line": 1,
- "offset": 17,
- },
- "source": "<template><div id",
- "start": {
- "column": 1,
- "line": 1,
- "offset": 0,
- },
- },
- "temps": 0,
- "type": 0,
-}
-`;
-
-exports[`compiler: parse > Errors > EOF_IN_TAG > <template><div id="abc 1`] = `
-{
- "cached": 0,
- "children": [
- {
- "children": [
- {
- "children": [],
- "codegenNode": undefined,
- "isSelfClosing": false,
- "loc": {
- "end": {
- "column": 23,
- "line": 1,
- "offset": 22,
- },
- "source": "<div id=\\"abc",
- "start": {
- "column": 11,
- "line": 1,
- "offset": 10,
- },
- },
- "ns": 0,
- "props": [
- {
- "loc": {
- "end": {
- "column": 23,
- "line": 1,
- "offset": 22,
- },
- "source": "id=\\"abc",
- "start": {
- "column": 16,
- "line": 1,
- "offset": 15,
- },
- },
- "name": "id",
- "type": 6,
- "value": {
- "content": "abc",
- "loc": {
- "end": {
- "column": 23,
- "line": 1,
- "offset": 22,
- },
- "source": "\\"abc",
- "start": {
- "column": 19,
- "line": 1,
- "offset": 18,
- },
- },
- "type": 2,
- },
- },
- ],
- "tag": "div",
- "tagType": 0,
- "type": 1,
- },
- ],
- "codegenNode": undefined,
- "isSelfClosing": false,
- "loc": {
- "end": {
- "column": 23,
- "line": 1,
- "offset": 22,
- },
- "source": "<template><div id=\\"abc",
- "start": {
- "column": 1,
- "line": 1,
- "offset": 0,
- },
- },
- "ns": 0,
- "props": [],
- "tag": "template",
- "tagType": 0,
- "type": 1,
- },
- ],
- "codegenNode": undefined,
- "components": [],
- "directives": [],
- "helpers": Set {},
- "hoists": [],
- "imports": [],
- "loc": {
- "end": {
- "column": 23,
- "line": 1,
- "offset": 22,
- },
- "source": "<template><div id=\\"abc",
- "start": {
- "column": 1,
- "line": 1,
- "offset": 0,
- },
- },
- "temps": 0,
- "type": 0,
-}
-`;
-
-exports[`compiler: parse > Errors > EOF_IN_TAG > <template><div id="abc" 1`] = `
-{
- "cached": 0,
- "children": [
- {
- "children": [
- {
- "children": [],
- "codegenNode": undefined,
- "isSelfClosing": false,
- "loc": {
- "end": {
- "column": 24,
- "line": 1,
- "offset": 23,
- },
- "source": "<div id=\\"abc\\"",
- "start": {
- "column": 11,
- "line": 1,
- "offset": 10,
- },
- },
- "ns": 0,
- "props": [
- {
- "loc": {
- "end": {
- "column": 24,
- "line": 1,
- "offset": 23,
- },
- "source": "id=\\"abc\\"",
- "start": {
- "column": 16,
- "line": 1,
- "offset": 15,
- },
- },
- "name": "id",
- "type": 6,
- "value": {
- "content": "abc",
- "loc": {
- "end": {
- "column": 24,
- "line": 1,
- "offset": 23,
- },
- "source": "\\"abc\\"",
- "start": {
- "column": 19,
- "line": 1,
- "offset": 18,
- },
- },
- "type": 2,
- },
- },
- ],
- "tag": "div",
- "tagType": 0,
- "type": 1,
- },
- ],
- "codegenNode": undefined,
- "isSelfClosing": false,
- "loc": {
- "end": {
- "column": 24,
- "line": 1,
- "offset": 23,
- },
- "source": "<template><div id=\\"abc\\"",
- "start": {
- "column": 1,
- "line": 1,
- "offset": 0,
- },
- },
- "ns": 0,
- "props": [],
- "tag": "template",
- "tagType": 0,
- "type": 1,
- },
- ],
- "codegenNode": undefined,
- "components": [],
- "directives": [],
- "helpers": Set {},
- "hoists": [],
- "imports": [],
- "loc": {
- "end": {
- "column": 24,
- "line": 1,
- "offset": 23,
- },
- "source": "<template><div id=\\"abc\\"",
- "start": {
- "column": 1,
- "line": 1,
- "offset": 0,
- },
- },
- "temps": 0,
- "type": 0,
-}
-`;
-
-exports[`compiler: parse > Errors > EOF_IN_TAG > <template><div id="abc"/ 1`] = `
-{
- "cached": 0,
- "children": [
- {
- "children": [
- {
- "children": [],
- "codegenNode": undefined,
- "isSelfClosing": false,
- "loc": {
- "end": {
- "column": 25,
- "line": 1,
- "offset": 24,
- },
- "source": "<div id=\\"abc\\"/",
- "start": {
- "column": 11,
- "line": 1,
- "offset": 10,
- },
- },
- "ns": 0,
- "props": [
- {
- "loc": {
- "end": {
- "column": 24,
- "line": 1,
- "offset": 23,
- },
- "source": "id=\\"abc\\"",
- "start": {
- "column": 16,
- "line": 1,
- "offset": 15,
- },
- },
- "name": "id",
- "type": 6,
- "value": {
- "content": "abc",
- "loc": {
- "end": {
- "column": 24,
- "line": 1,
- "offset": 23,
- },
- "source": "\\"abc\\"",
- "start": {
- "column": 19,
- "line": 1,
- "offset": 18,
- },
- },
- "type": 2,
- },
- },
- ],
- "tag": "div",
- "tagType": 0,
- "type": 1,
- },
- ],
- "codegenNode": undefined,
- "isSelfClosing": false,
- "loc": {
- "end": {
- "column": 25,
- "line": 1,
- "offset": 24,
- },
- "source": "<template><div id=\\"abc\\"/",
- "start": {
- "column": 1,
- "line": 1,
- "offset": 0,
- },
- },
- "ns": 0,
- "props": [],
- "tag": "template",
- "tagType": 0,
- "type": 1,
- },
- ],
- "codegenNode": undefined,
- "components": [],
- "directives": [],
- "helpers": Set {},
- "hoists": [],
- "imports": [],
- "loc": {
- "end": {
- "column": 25,
- "line": 1,
- "offset": 24,
- },
- "source": "<template><div id=\\"abc\\"/",
- "start": {
- "column": 1,
- "line": 1,
- "offset": 0,
- },
- },
- "temps": 0,
- "type": 0,
-}
-`;
-
-exports[`compiler: parse > Errors > EOF_IN_TAG > <template><div id='abc 1`] = `
-{
- "cached": 0,
- "children": [
- {
- "children": [
- {
- "children": [],
- "codegenNode": undefined,
- "isSelfClosing": false,
- "loc": {
- "end": {
- "column": 23,
- "line": 1,
- "offset": 22,
- },
- "source": "<div id='abc",
- "start": {
- "column": 11,
- "line": 1,
- "offset": 10,
- },
- },
- "ns": 0,
- "props": [
- {
- "loc": {
- "end": {
- "column": 23,
- "line": 1,
- "offset": 22,
- },
- "source": "id='abc",
- "start": {
- "column": 16,
- "line": 1,
- "offset": 15,
- },
- },
- "name": "id",
- "type": 6,
- "value": {
- "content": "abc",
- "loc": {
- "end": {
- "column": 23,
- "line": 1,
- "offset": 22,
- },
- "source": "'abc",
- "start": {
- "column": 19,
- "line": 1,
- "offset": 18,
- },
- },
- "type": 2,
- },
- },
- ],
- "tag": "div",
- "tagType": 0,
- "type": 1,
- },
- ],
- "codegenNode": undefined,
- "isSelfClosing": false,
- "loc": {
- "end": {
- "column": 23,
- "line": 1,
- "offset": 22,
- },
- "source": "<template><div id='abc",
- "start": {
- "column": 1,
- "line": 1,
- "offset": 0,
- },
- },
- "ns": 0,
- "props": [],
- "tag": "template",
- "tagType": 0,
- "type": 1,
- },
- ],
- "codegenNode": undefined,
- "components": [],
- "directives": [],
- "helpers": Set {},
- "hoists": [],
- "imports": [],
- "loc": {
- "end": {
- "column": 23,
- "line": 1,
- "offset": 22,
- },
- "source": "<template><div id='abc",
- "start": {
- "column": 1,
- "line": 1,
- "offset": 0,
- },
- },
- "temps": 0,
- "type": 0,
-}
-`;
-
-exports[`compiler: parse > Errors > EOF_IN_TAG > <template><div id='abc' 1`] = `
-{
- "cached": 0,
- "children": [
- {
- "children": [
- {
- "children": [],
- "codegenNode": undefined,
- "isSelfClosing": false,
- "loc": {
- "end": {
- "column": 24,
- "line": 1,
- "offset": 23,
- },
- "source": "<div id='abc'",
- "start": {
- "column": 11,
- "line": 1,
- "offset": 10,
- },
- },
- "ns": 0,
- "props": [
- {
- "loc": {
- "end": {
- "column": 24,
- "line": 1,
- "offset": 23,
- },
- "source": "id='abc'",
- "start": {
- "column": 16,
- "line": 1,
- "offset": 15,
- },
- },
- "name": "id",
- "type": 6,
- "value": {
- "content": "abc",
- "loc": {
- "end": {
- "column": 24,
- "line": 1,
- "offset": 23,
- },
- "source": "'abc'",
- "start": {
- "column": 19,
- "line": 1,
- "offset": 18,
- },
- },
- "type": 2,
- },
- },
- ],
- "tag": "div",
- "tagType": 0,
- "type": 1,
- },
- ],
- "codegenNode": undefined,
- "isSelfClosing": false,
- "loc": {
- "end": {
- "column": 24,
- "line": 1,
- "offset": 23,
- },
- "source": "<template><div id='abc'",
- "start": {
- "column": 1,
- "line": 1,
- "offset": 0,
- },
- },
- "ns": 0,
- "props": [],
- "tag": "template",
- "tagType": 0,
- "type": 1,
- },
- ],
- "codegenNode": undefined,
- "components": [],
- "directives": [],
- "helpers": Set {},
- "hoists": [],
- "imports": [],
- "loc": {
- "end": {
- "column": 24,
- "line": 1,
- "offset": 23,
- },
- "source": "<template><div id='abc'",
- "start": {
- "column": 1,
- "line": 1,
- "offset": 0,
- },
- },
- "temps": 0,
- "type": 0,
-}
-`;
-
-exports[`compiler: parse > Errors > EOF_IN_TAG > <template><div id='abc'/ 1`] = `
-{
- "cached": 0,
- "children": [
- {
- "children": [
- {
- "children": [],
- "codegenNode": undefined,
- "isSelfClosing": false,
- "loc": {
- "end": {
- "column": 25,
- "line": 1,
- "offset": 24,
- },
- "source": "<div id='abc'/",
- "start": {
- "column": 11,
- "line": 1,
- "offset": 10,
- },
- },
- "ns": 0,
- "props": [
- {
- "loc": {
- "end": {
- "column": 24,
- "line": 1,
- "offset": 23,
- },
- "source": "id='abc'",
- "start": {
- "column": 16,
- "line": 1,
- "offset": 15,
- },
- },
- "name": "id",
- "type": 6,
- "value": {
- "content": "abc",
- "loc": {
- "end": {
- "column": 24,
- "line": 1,
- "offset": 23,
- },
- "source": "'abc'",
- "start": {
- "column": 19,
- "line": 1,
- "offset": 18,
- },
- },
- "type": 2,
- },
- },
- ],
- "tag": "div",
- "tagType": 0,
- "type": 1,
- },
- ],
- "codegenNode": undefined,
- "isSelfClosing": false,
- "loc": {
- "end": {
- "column": 25,
- "line": 1,
- "offset": 24,
- },
- "source": "<template><div id='abc'/",
- "start": {
- "column": 1,
- "line": 1,
- "offset": 0,
- },
- },
- "ns": 0,
- "props": [],
- "tag": "template",
- "tagType": 0,
- "type": 1,
- },
- ],
- "codegenNode": undefined,
- "components": [],
- "directives": [],
- "helpers": Set {},
- "hoists": [],
- "imports": [],
- "loc": {
- "end": {
- "column": 25,
- "line": 1,
- "offset": 24,
- },
- "source": "<template><div id='abc'/",
- "start": {
- "column": 1,
- "line": 1,
- "offset": 0,
- },
- },
- "temps": 0,
- "type": 0,
-}
-`;
-
-exports[`compiler: parse > Errors > EOF_IN_TAG > <template><div id=abc / 1`] = `
-{
- "cached": 0,
- "children": [
- {
- "children": [
- {
- "children": [],
- "codegenNode": undefined,
- "isSelfClosing": false,
- "loc": {
- "end": {
- "column": 24,
- "line": 1,
- "offset": 23,
- },
- "source": "<div id=abc /",
- "start": {
- "column": 11,
- "line": 1,
- "offset": 10,
- },
- },
- "ns": 0,
- "props": [
- {
- "loc": {
- "end": {
- "column": 22,
- "line": 1,
- "offset": 21,
- },
- "source": "id=abc",
- "start": {
- "column": 16,
- "line": 1,
- "offset": 15,
- },
- },
- "name": "id",
- "type": 6,
- "value": {
- "content": "abc",
- "loc": {
- "end": {
- "column": 22,
- "line": 1,
- "offset": 21,
- },
- "source": "abc",
- "start": {
- "column": 19,
- "line": 1,
- "offset": 18,
- },
- },
- "type": 2,
- },
- },
- ],
- "tag": "div",
- "tagType": 0,
- "type": 1,
- },
- ],
- "codegenNode": undefined,
- "isSelfClosing": false,
- "loc": {
- "end": {
- "column": 24,
- "line": 1,
- "offset": 23,
- },
- "source": "<template><div id=abc /",
- "start": {
- "column": 1,
- "line": 1,
- "offset": 0,
- },
- },
- "ns": 0,
- "props": [],
- "tag": "template",
- "tagType": 0,
- "type": 1,
- },
- ],
- "codegenNode": undefined,
- "components": [],
- "directives": [],
- "helpers": Set {},
- "hoists": [],
- "imports": [],
- "loc": {
- "end": {
- "column": 24,
- "line": 1,
- "offset": 23,
- },
- "source": "<template><div id=abc /",
- "start": {
- "column": 1,
- "line": 1,
- "offset": 0,
- },
- },
- "temps": 0,
- "type": 0,
-}
-`;
-
-exports[`compiler: parse > Errors > EOF_IN_TAG > <template><div id=abc 1`] = `
-{
- "cached": 0,
- "children": [
- {
- "children": [
- {
- "children": [],
- "codegenNode": undefined,
- "isSelfClosing": false,
- "loc": {
- "end": {
- "column": 22,
- "line": 1,
- "offset": 21,
- },
- "source": "<div id=abc",
- "start": {
- "column": 11,
- "line": 1,
- "offset": 10,
- },
- },
- "ns": 0,
- "props": [
- {
- "loc": {
- "end": {
- "column": 22,
- "line": 1,
- "offset": 21,
- },
- "source": "id=abc",
- "start": {
- "column": 16,
- "line": 1,
- "offset": 15,
- },
- },
- "name": "id",
- "type": 6,
- "value": {
- "content": "abc",
- "loc": {
- "end": {
- "column": 22,
- "line": 1,
- "offset": 21,
- },
- "source": "abc",
- "start": {
- "column": 19,
- "line": 1,
- "offset": 18,
- },
- },
- "type": 2,
- },
- },
- ],
- "tag": "div",
- "tagType": 0,
- "type": 1,
- },
- ],
- "codegenNode": undefined,
- "isSelfClosing": false,
- "loc": {
- "end": {
- "column": 22,
- "line": 1,
- "offset": 21,
- },
- "source": "<template><div id=abc",
- "start": {
- "column": 1,
- "line": 1,
- "offset": 0,
- },
- },
- "ns": 0,
- "props": [],
- "tag": "template",
- "tagType": 0,
- "type": 1,
- },
- ],
- "codegenNode": undefined,
- "components": [],
- "directives": [],
- "helpers": Set {},
- "hoists": [],
- "imports": [],
- "loc": {
- "end": {
- "column": 22,
- "line": 1,
- "offset": 21,
- },
- "source": "<template><div id=abc",
- "start": {
- "column": 1,
- "line": 1,
- "offset": 0,
- },
- },
- "temps": 0,
- "type": 0,
-}
-`;
-
-exports[`compiler: parse > Errors > INCORRECTLY_CLOSED_COMMENT > <template><!--comment--!></template> 1`] = `
-{
- "cached": 0,
- "children": [
- {
- "children": [
- {
- "content": "comment",
- "loc": {
- "end": {
- "column": 26,
- "line": 1,
- "offset": 25,
- },
- "source": "<!--comment--!>",
- "start": {
- "column": 11,
- "line": 1,
- "offset": 10,
- },
- },
- "type": 3,
- },
- ],
- "codegenNode": undefined,
- "isSelfClosing": false,
- "loc": {
- "end": {
- "column": 37,
- "line": 1,
- "offset": 36,
- },
- "source": "<template><!--comment--!></template>",
- "start": {
- "column": 1,
- "line": 1,
- "offset": 0,
- },
- },
- "ns": 0,
- "props": [],
- "tag": "template",
- "tagType": 0,
- "type": 1,
- },
- ],
- "codegenNode": undefined,
- "components": [],
- "directives": [],
- "helpers": Set {},
- "hoists": [],
- "imports": [],
- "loc": {
- "end": {
- "column": 37,
- "line": 1,
- "offset": 36,
- },
- "source": "<template><!--comment--!></template>",
- "start": {
- "column": 1,
- "line": 1,
- "offset": 0,
- },
- },
- "temps": 0,
- "type": 0,
-}
-`;
-
-exports[`compiler: parse > Errors > INCORRECTLY_OPENED_COMMENT > <!DOCTYPE html> 1`] = `
-{
- "cached": 0,
- "children": [
- {
- "content": "DOCTYPE html",
- "loc": {
- "end": {
- "column": 16,
- "line": 1,
- "offset": 15,
- },
- "source": "<!DOCTYPE html>",
- "start": {
- "column": 1,
- "line": 1,
- "offset": 0,
- },
- },
- "type": 3,
- },
- ],
- "codegenNode": undefined,
- "components": [],
- "directives": [],
- "helpers": Set {},
- "hoists": [],
- "imports": [],
- "loc": {
- "end": {
- "column": 16,
- "line": 1,
- "offset": 15,
- },
- "source": "<!DOCTYPE html>",
- "start": {
- "column": 1,
- "line": 1,
- "offset": 0,
- },
- },
- "temps": 0,
- "type": 0,
-}
-`;
-
-exports[`compiler: parse > Errors > INCORRECTLY_OPENED_COMMENT > <template><!></template> 1`] = `
-{
- "cached": 0,
- "children": [
- {
- "children": [
- {
- "content": "",
- "loc": {
- "end": {
- "column": 14,
- "line": 1,
- "offset": 13,
- },
- "source": "<!>",
- "start": {
- "column": 11,
- "line": 1,
- "offset": 10,
- },
- },
- "type": 3,
- },
- ],
- "codegenNode": undefined,
- "isSelfClosing": false,
- "loc": {
- "end": {
- "column": 25,
- "line": 1,
- "offset": 24,
- },
- "source": "<template><!></template>",
- "start": {
- "column": 1,
- "line": 1,
- "offset": 0,
- },
- },
- "ns": 0,
- "props": [],
- "tag": "template",
- "tagType": 0,
- "type": 1,
- },
- ],
- "codegenNode": undefined,
- "components": [],
- "directives": [],
- "helpers": Set {},
- "hoists": [],
- "imports": [],
- "loc": {
- "end": {
- "column": 25,
- "line": 1,
- "offset": 24,
- },
- "source": "<template><!></template>",
- "start": {
- "column": 1,
- "line": 1,
- "offset": 0,
- },
- },
- "temps": 0,
- "type": 0,
-}
-`;
-
-exports[`compiler: parse > Errors > INCORRECTLY_OPENED_COMMENT > <template><!-></template> 1`] = `
-{
- "cached": 0,
- "children": [
- {
- "children": [
- {
- "content": "-",
- "loc": {
- "end": {
- "column": 15,
- "line": 1,
- "offset": 14,
- },
- "source": "<!->",
- "start": {
- "column": 11,
- "line": 1,
- "offset": 10,
- },
- },
- "type": 3,
- },
- ],
- "codegenNode": undefined,
- "isSelfClosing": false,
- "loc": {
- "end": {
- "column": 26,
- "line": 1,
- "offset": 25,
- },
- "source": "<template><!-></template>",
- "start": {
- "column": 1,
- "line": 1,
- "offset": 0,
- },
- },
- "ns": 0,
- "props": [],
- "tag": "template",
- "tagType": 0,
- "type": 1,
- },
- ],
- "codegenNode": undefined,
- "components": [],
- "directives": [],
- "helpers": Set {},
- "hoists": [],
- "imports": [],
- "loc": {
- "end": {
- "column": 26,
- "line": 1,
- "offset": 25,
- },
- "source": "<template><!-></template>",
- "start": {
- "column": 1,
- "line": 1,
- "offset": 0,
- },
- },
- "temps": 0,
- "type": 0,
-}
-`;
-
-exports[`compiler: parse > Errors > INCORRECTLY_OPENED_COMMENT > <template><!ELEMENT br EMPTY></template> 1`] = `
-{
- "cached": 0,
- "children": [
- {
- "children": [
- {
- "content": "ELEMENT br EMPTY",
- "loc": {
- "end": {
- "column": 30,
- "line": 1,
- "offset": 29,
- },
- "source": "<!ELEMENT br EMPTY>",
- "start": {
- "column": 11,
- "line": 1,
- "offset": 10,
- },
- },
- "type": 3,
- },
- ],
- "codegenNode": undefined,
- "isSelfClosing": false,
- "loc": {
- "end": {
- "column": 41,
- "line": 1,
- "offset": 40,
- },
- "source": "<template><!ELEMENT br EMPTY></template>",
- "start": {
- "column": 1,
- "line": 1,
- "offset": 0,
- },
- },
- "ns": 0,
- "props": [],
- "tag": "template",
- "tagType": 0,
- "type": 1,
- },
- ],
- "codegenNode": undefined,
- "components": [],
- "directives": [],
- "helpers": Set {},
- "hoists": [],
- "imports": [],
- "loc": {
- "end": {
- "column": 41,
- "line": 1,
- "offset": 40,
- },
- "source": "<template><!ELEMENT br EMPTY></template>",
- "start": {
- "column": 1,
- "line": 1,
- "offset": 0,
- },
- },
- "temps": 0,
- "type": 0,
-}
-`;
-
-exports[`compiler: parse > Errors > INVALID_FIRST_CHARACTER_OF_TAG_NAME > <template></�></template> 1`] = `
-{
- "cached": 0,
- "children": [
- {
- "children": [
- {
- "content": "�",
- "loc": {
- "end": {
- "column": 15,
- "line": 1,
- "offset": 14,
- },
- "source": "</�>",
- "start": {
- "column": 11,
- "line": 1,
- "offset": 10,
- },
- },
- "type": 3,
- },
- ],
- "codegenNode": undefined,
- "isSelfClosing": false,
- "loc": {
- "end": {
- "column": 26,
- "line": 1,
- "offset": 25,
- },
- "source": "<template></�></template>",
- "start": {
- "column": 1,
- "line": 1,
- "offset": 0,
- },
- },
- "ns": 0,
- "props": [],
- "tag": "template",
- "tagType": 0,
- "type": 1,
- },
- ],
- "codegenNode": undefined,
- "components": [],
- "directives": [],
- "helpers": Set {},
- "hoists": [],
- "imports": [],
- "loc": {
- "end": {
- "column": 26,
- "line": 1,
- "offset": 25,
- },
- "source": "<template></�></template>",
- "start": {
- "column": 1,
- "line": 1,
- "offset": 0,
- },
- },
- "temps": 0,
- "type": 0,
-}
-`;
-
-exports[`compiler: parse > Errors > INVALID_FIRST_CHARACTER_OF_TAG_NAME > <template><�></template> 1`] = `
-{
- "cached": 0,
- "children": [
- {
- "children": [
- {
- "content": "<�>",
- "loc": {
- "end": {
- "column": 14,
- "line": 1,
- "offset": 13,
- },
- "source": "<�>",
- "start": {
- "column": 11,
- "line": 1,
- "offset": 10,
- },
- },
- "type": 2,
- },
- ],
- "codegenNode": undefined,
- "isSelfClosing": false,
- "loc": {
- "end": {
- "column": 25,
- "line": 1,
- "offset": 24,
- },
- "source": "<template><�></template>",
- "start": {
- "column": 1,
- "line": 1,
- "offset": 0,
- },
- },
- "ns": 0,
- "props": [],
- "tag": "template",
- "tagType": 0,
- "type": 1,
- },
- ],
- "codegenNode": undefined,
- "components": [],
- "directives": [],
- "helpers": Set {},
- "hoists": [],
- "imports": [],
- "loc": {
- "end": {
- "column": 25,
- "line": 1,
- "offset": 24,
- },
- "source": "<template><�></template>",
- "start": {
- "column": 1,
- "line": 1,
- "offset": 0,
- },
- },
- "temps": 0,
- "type": 0,
-}
-`;
-
-exports[`compiler: parse > Errors > INVALID_FIRST_CHARACTER_OF_TAG_NAME > <template>{{a < b}}</template> 1`] = `
-{
- "cached": 0,
- "children": [
- {
- "children": [
- {
- "content": {
- "constType": 0,
- "content": "a < b",
- "isStatic": false,
- "loc": {
- "end": {
- "column": 18,
- "line": 1,
- "offset": 17,
- },
- "source": "a < b",
- "start": {
- "column": 13,
- "line": 1,
- "offset": 12,
- },
- },
- "type": 4,
- },
- "loc": {
- "end": {
- "column": 20,
- "line": 1,
- "offset": 19,
- },
- "source": "{{a < b}}",
- "start": {
- "column": 11,
- "line": 1,
- "offset": 10,
- },
- },
- "type": 5,
- },
- ],
- "codegenNode": undefined,
- "isSelfClosing": false,
- "loc": {
- "end": {
- "column": 31,
- "line": 1,
- "offset": 30,
- },
- "source": "<template>{{a < b}}</template>",
- "start": {
- "column": 1,
- "line": 1,
- "offset": 0,
- },
- },
- "ns": 0,
- "props": [],
- "tag": "template",
- "tagType": 0,
- "type": 1,
- },
- ],
- "codegenNode": undefined,
- "components": [],
- "directives": [],
- "helpers": Set {},
- "hoists": [],
- "imports": [],
- "loc": {
- "end": {
- "column": 31,
- "line": 1,
- "offset": 30,
- },
- "source": "<template>{{a < b}}</template>",
- "start": {
- "column": 1,
- "line": 1,
- "offset": 0,
- },
- },
- "temps": 0,
- "type": 0,
-}
-`;
-
-exports[`compiler: parse > Errors > INVALID_FIRST_CHARACTER_OF_TAG_NAME > <template>a < b</template> 1`] = `
-{
- "cached": 0,
- "children": [
- {
- "children": [
- {
- "content": "a < b",
- "loc": {
- "end": {
- "column": 16,
- "line": 1,
- "offset": 15,
- },
- "source": "a < b",
- "start": {
- "column": 11,
- "line": 1,
- "offset": 10,
- },
- },
- "type": 2,
- },
- ],
- "codegenNode": undefined,
- "isSelfClosing": false,
- "loc": {
- "end": {
- "column": 27,
- "line": 1,
- "offset": 26,
- },
- "source": "<template>a < b</template>",
- "start": {
- "column": 1,
- "line": 1,
- "offset": 0,
- },
- },
- "ns": 0,
- "props": [],
- "tag": "template",
- "tagType": 0,
- "type": 1,
- },
- ],
- "codegenNode": undefined,
- "components": [],
- "directives": [],
- "helpers": Set {},
- "hoists": [],
- "imports": [],
- "loc": {
- "end": {
- "column": 27,
- "line": 1,
- "offset": 26,
- },
- "source": "<template>a < b</template>",
- "start": {
- "column": 1,
- "line": 1,
- "offset": 0,
- },
- },
- "temps": 0,
- "type": 0,
-}
-`;
-
-exports[`compiler: parse > Errors > INVALID_FIRST_CHARACTER_OF_TAG_NAME > <template>a </ b</template> 1`] = `
-{
- "cached": 0,
- "children": [
- {
- "children": [
- {
- "content": "a ",
- "loc": {
- "end": {
- "column": 13,
- "line": 1,
- "offset": 12,
- },
- "source": "a ",
- "start": {
- "column": 11,
- "line": 1,
- "offset": 10,
- },
- },
- "type": 2,
- },
- {
- "content": " b</template",
- "loc": {
- "end": {
- "column": 28,
- "line": 1,
- "offset": 27,
- },
- "source": "</ b</template>",
- "start": {
- "column": 13,
- "line": 1,
- "offset": 12,
- },
- },
- "type": 3,
- },
- ],
- "codegenNode": undefined,
- "isSelfClosing": false,
- "loc": {
- "end": {
- "column": 28,
- "line": 1,
- "offset": 27,
- },
- "source": "<template>a </ b</template>",
- "start": {
- "column": 1,
- "line": 1,
- "offset": 0,
- },
- },
- "ns": 0,
- "props": [],
- "tag": "template",
- "tagType": 0,
- "type": 1,
- },
- ],
- "codegenNode": undefined,
- "components": [],
- "directives": [],
- "helpers": Set {},
- "hoists": [],
- "imports": [],
- "loc": {
- "end": {
- "column": 28,
- "line": 1,
- "offset": 27,
- },
- "source": "<template>a </ b</template>",
- "start": {
- "column": 1,
- "line": 1,
- "offset": 0,
- },
- },
- "temps": 0,
- "type": 0,
-}
-`;
-
-exports[`compiler: parse > Errors > MISSING_ATTRIBUTE_VALUE > <template><div id= /></div></template> 1`] = `
-{
- "cached": 0,
- "children": [
- {
- "children": [
- {
- "children": [],
- "codegenNode": undefined,
- "isSelfClosing": false,
- "loc": {
- "end": {
- "column": 28,
- "line": 1,
- "offset": 27,
- },
- "source": "<div id= /></div>",
- "start": {
- "column": 11,
- "line": 1,
- "offset": 10,
- },
- },
- "ns": 0,
- "props": [
- {
- "loc": {
- "end": {
- "column": 21,
- "line": 1,
- "offset": 20,
- },
- "source": "id= /",
- "start": {
- "column": 16,
- "line": 1,
- "offset": 15,
- },
- },
- "name": "id",
- "type": 6,
- "value": {
- "content": "/",
- "loc": {
- "end": {
- "column": 21,
- "line": 1,
- "offset": 20,
- },
- "source": "/",
- "start": {
- "column": 20,
- "line": 1,
- "offset": 19,
- },
- },
- "type": 2,
- },
- },
- ],
- "tag": "div",
- "tagType": 0,
- "type": 1,
- },
- ],
- "codegenNode": undefined,
- "isSelfClosing": false,
- "loc": {
- "end": {
- "column": 39,
- "line": 1,
- "offset": 38,
- },
- "source": "<template><div id= /></div></template>",
- "start": {
- "column": 1,
- "line": 1,
- "offset": 0,
- },
- },
- "ns": 0,
- "props": [],
- "tag": "template",
- "tagType": 0,
- "type": 1,
- },
- ],
- "codegenNode": undefined,
- "components": [],
- "directives": [],
- "helpers": Set {},
- "hoists": [],
- "imports": [],
- "loc": {
- "end": {
- "column": 39,
- "line": 1,
- "offset": 38,
- },
- "source": "<template><div id= /></div></template>",
- "start": {
- "column": 1,
- "line": 1,
- "offset": 0,
- },
- },
- "temps": 0,
- "type": 0,
-}
-`;
-
-exports[`compiler: parse > Errors > MISSING_ATTRIBUTE_VALUE > <template><div id= ></div></template> 1`] = `
-{
- "cached": 0,
- "children": [
- {
- "children": [
- {
- "children": [],
- "codegenNode": undefined,
- "isSelfClosing": false,
- "loc": {
- "end": {
- "column": 27,
- "line": 1,
- "offset": 26,
- },
- "source": "<div id= ></div>",
- "start": {
- "column": 11,
- "line": 1,
- "offset": 10,
- },
- },
- "ns": 0,
- "props": [
- {
- "loc": {
- "end": {
- "column": 20,
- "line": 1,
- "offset": 19,
- },
- "source": "id= ",
- "start": {
- "column": 16,
- "line": 1,
- "offset": 15,
- },
- },
- "name": "id",
- "type": 6,
- "value": undefined,
- },
- ],
- "tag": "div",
- "tagType": 0,
- "type": 1,
- },
- ],
- "codegenNode": undefined,
- "isSelfClosing": false,
- "loc": {
- "end": {
- "column": 38,
- "line": 1,
- "offset": 37,
- },
- "source": "<template><div id= ></div></template>",
- "start": {
- "column": 1,
- "line": 1,
- "offset": 0,
- },
- },
- "ns": 0,
- "props": [],
- "tag": "template",
- "tagType": 0,
- "type": 1,
- },
- ],
- "codegenNode": undefined,
- "components": [],
- "directives": [],
- "helpers": Set {},
- "hoists": [],
- "imports": [],
- "loc": {
- "end": {
- "column": 38,
- "line": 1,
- "offset": 37,
- },
- "source": "<template><div id= ></div></template>",
- "start": {
- "column": 1,
- "line": 1,
- "offset": 0,
- },
- },
- "temps": 0,
- "type": 0,
-}
-`;
-
-exports[`compiler: parse > Errors > MISSING_ATTRIBUTE_VALUE > <template><div id=></div></template> 1`] = `
-{
- "cached": 0,
- "children": [
- {
- "children": [
- {
- "children": [],
- "codegenNode": undefined,
- "isSelfClosing": false,
- "loc": {
- "end": {
- "column": 26,
- "line": 1,
- "offset": 25,
- },
- "source": "<div id=></div>",
- "start": {
- "column": 11,
- "line": 1,
- "offset": 10,
- },
- },
- "ns": 0,
- "props": [
- {
- "loc": {
- "end": {
- "column": 19,
- "line": 1,
- "offset": 18,
- },
- "source": "id=",
- "start": {
- "column": 16,
- "line": 1,
- "offset": 15,
- },
- },
- "name": "id",
- "type": 6,
- "value": undefined,
- },
- ],
- "tag": "div",
- "tagType": 0,
- "type": 1,
- },
- ],
- "codegenNode": undefined,
- "isSelfClosing": false,
- "loc": {
- "end": {
- "column": 37,
- "line": 1,
- "offset": 36,
- },
- "source": "<template><div id=></div></template>",
- "start": {
- "column": 1,
- "line": 1,
- "offset": 0,
- },
- },
- "ns": 0,
- "props": [],
- "tag": "template",
- "tagType": 0,
- "type": 1,
- },
- ],
- "codegenNode": undefined,
- "components": [],
- "directives": [],
- "helpers": Set {},
- "hoists": [],
- "imports": [],
- "loc": {
- "end": {
- "column": 37,
- "line": 1,
- "offset": 36,
- },
- "source": "<template><div id=></div></template>",
- "start": {
- "column": 1,
- "line": 1,
- "offset": 0,
- },
- },
- "temps": 0,
- "type": 0,
-}
-`;
-
-exports[`compiler: parse > Errors > MISSING_END_TAG_NAME > <template></></template> 1`] = `
-{
- "cached": 0,
- "children": [
- {
- "children": [],
- "codegenNode": undefined,
- "isSelfClosing": false,
- "loc": {
- "end": {
- "column": 25,
- "line": 1,
- "offset": 24,
- },
- "source": "<template></></template>",
- "start": {
- "column": 1,
- "line": 1,
- "offset": 0,
- },
- },
- "ns": 0,
- "props": [],
- "tag": "template",
- "tagType": 0,
- "type": 1,
- },
- ],
- "codegenNode": undefined,
- "components": [],
- "directives": [],
- "helpers": Set {},
- "hoists": [],
- "imports": [],
- "loc": {
- "end": {
- "column": 25,
- "line": 1,
- "offset": 24,
- },
- "source": "<template></></template>",
- "start": {
- "column": 1,
- "line": 1,
- "offset": 0,
- },
- },
- "temps": 0,
- "type": 0,
-}
-`;
-
-exports[`compiler: parse > Errors > MISSING_WHITESPACE_BETWEEN_ATTRIBUTES > <template><div id="foo"\\x0d;\\x0a;class="bar"></div></template> 1`] = `
-{
- "cached": 0,
- "children": [
- {
- "children": [
- {
- "children": [],
- "codegenNode": undefined,
- "isSelfClosing": false,
- "loc": {
- "end": {
- "column": 19,
- "line": 2,
- "offset": 43,
- },
- "source": "<div id=\\"foo\\"
-class=\\"bar\\"></div>",
- "start": {
- "column": 11,
- "line": 1,
- "offset": 10,
- },
- },
- "ns": 0,
- "props": [
- {
- "loc": {
- "end": {
- "column": 24,
- "line": 1,
- "offset": 23,
- },
- "source": "id=\\"foo\\"",
- "start": {
- "column": 16,
- "line": 1,
- "offset": 15,
- },
- },
- "name": "id",
- "type": 6,
- "value": {
- "content": "foo",
- "loc": {
- "end": {
- "column": 24,
- "line": 1,
- "offset": 23,
- },
- "source": "\\"foo\\"",
- "start": {
- "column": 19,
- "line": 1,
- "offset": 18,
- },
- },
- "type": 2,
- },
- },
- {
- "loc": {
- "end": {
- "column": 12,
- "line": 2,
- "offset": 36,
- },
- "source": "class=\\"bar\\"",
- "start": {
- "column": 1,
- "line": 2,
- "offset": 25,
- },
- },
- "name": "class",
- "type": 6,
- "value": {
- "content": "bar",
- "loc": {
- "end": {
- "column": 12,
- "line": 2,
- "offset": 36,
- },
- "source": "\\"bar\\"",
- "start": {
- "column": 7,
- "line": 2,
- "offset": 31,
- },
- },
- "type": 2,
- },
- },
- ],
- "tag": "div",
- "tagType": 0,
- "type": 1,
- },
- ],
- "codegenNode": undefined,
- "isSelfClosing": false,
- "loc": {
- "end": {
- "column": 30,
- "line": 2,
- "offset": 54,
- },
- "source": "<template><div id=\\"foo\\"
-class=\\"bar\\"></div></template>",
- "start": {
- "column": 1,
- "line": 1,
- "offset": 0,
- },
- },
- "ns": 0,
- "props": [],
- "tag": "template",
- "tagType": 0,
- "type": 1,
- },
- ],
- "codegenNode": undefined,
- "components": [],
- "directives": [],
- "helpers": Set {},
- "hoists": [],
- "imports": [],
- "loc": {
- "end": {
- "column": 30,
- "line": 2,
- "offset": 54,
- },
- "source": "<template><div id=\\"foo\\"
-class=\\"bar\\"></div></template>",
- "start": {
- "column": 1,
- "line": 1,
- "offset": 0,
- },
- },
- "temps": 0,
- "type": 0,
-}
-`;
-
-exports[`compiler: parse > Errors > MISSING_WHITESPACE_BETWEEN_ATTRIBUTES > <template><div id="foo"class="bar"></div></template> 1`] = `
-{
- "cached": 0,
- "children": [
- {
- "children": [
- {
- "children": [],
- "codegenNode": undefined,
- "isSelfClosing": false,
- "loc": {
- "end": {
- "column": 42,
- "line": 1,
- "offset": 41,
- },
- "source": "<div id=\\"foo\\"class=\\"bar\\"></div>",
- "start": {
- "column": 11,
- "line": 1,
- "offset": 10,
- },
- },
- "ns": 0,
- "props": [
- {
- "loc": {
- "end": {
- "column": 24,
- "line": 1,
- "offset": 23,
- },
- "source": "id=\\"foo\\"",
- "start": {
- "column": 16,
- "line": 1,
- "offset": 15,
- },
- },
- "name": "id",
- "type": 6,
- "value": {
- "content": "foo",
- "loc": {
- "end": {
- "column": 24,
- "line": 1,
- "offset": 23,
- },
- "source": "\\"foo\\"",
- "start": {
- "column": 19,
- "line": 1,
- "offset": 18,
- },
- },
- "type": 2,
- },
- },
- {
- "loc": {
- "end": {
- "column": 35,
- "line": 1,
- "offset": 34,
- },
- "source": "class=\\"bar\\"",
- "start": {
- "column": 24,
- "line": 1,
- "offset": 23,
- },
- },
- "name": "class",
- "type": 6,
- "value": {
- "content": "bar",
- "loc": {
- "end": {
- "column": 35,
- "line": 1,
- "offset": 34,
- },
- "source": "\\"bar\\"",
- "start": {
- "column": 30,
- "line": 1,
- "offset": 29,
- },
- },
- "type": 2,
- },
- },
- ],
- "tag": "div",
- "tagType": 0,
- "type": 1,
- },
- ],
- "codegenNode": undefined,
- "isSelfClosing": false,
- "loc": {
- "end": {
- "column": 53,
- "line": 1,
- "offset": 52,
- },
- "source": "<template><div id=\\"foo\\"class=\\"bar\\"></div></template>",
- "start": {
- "column": 1,
- "line": 1,
- "offset": 0,
- },
- },
- "ns": 0,
- "props": [],
- "tag": "template",
- "tagType": 0,
- "type": 1,
- },
- ],
- "codegenNode": undefined,
- "components": [],
- "directives": [],
- "helpers": Set {},
- "hoists": [],
- "imports": [],
- "loc": {
- "end": {
- "column": 53,
- "line": 1,
- "offset": 52,
- },
- "source": "<template><div id=\\"foo\\"class=\\"bar\\"></div></template>",
- "start": {
- "column": 1,
- "line": 1,
- "offset": 0,
- },
- },
- "temps": 0,
- "type": 0,
-}
-`;
-
-exports[`compiler: parse > Errors > NESTED_COMMENT > <template><!--a<!-- 1`] = `
-{
- "cached": 0,
- "children": [
- {
- "children": [
- {
- "content": "a<!--",
- "loc": {
- "end": {
- "column": 20,
- "line": 1,
- "offset": 19,
- },
- "source": "<!--a<!--",
- "start": {
- "column": 11,
- "line": 1,
- "offset": 10,
- },
- },
- "type": 3,
- },
- ],
- "codegenNode": undefined,
- "isSelfClosing": false,
- "loc": {
- "end": {
- "column": 20,
- "line": 1,
- "offset": 19,
- },
- "source": "<template><!--a<!--",
- "start": {
- "column": 1,
- "line": 1,
- "offset": 0,
- },
- },
- "ns": 0,
- "props": [],
- "tag": "template",
- "tagType": 0,
- "type": 1,
- },
- ],
- "codegenNode": undefined,
- "components": [],
- "directives": [],
- "helpers": Set {},
- "hoists": [],
- "imports": [],
- "loc": {
- "end": {
- "column": 20,
- "line": 1,
- "offset": 19,
- },
- "source": "<template><!--a<!--",
- "start": {
- "column": 1,
- "line": 1,
- "offset": 0,
- },
- },
- "temps": 0,
- "type": 0,
-}
-`;
-
-exports[`compiler: parse > Errors > NESTED_COMMENT > <template><!--a<!--></template> 1`] = `
-{
- "cached": 0,
- "children": [
- {
- "children": [
- {
- "content": "a<!",
- "loc": {
- "end": {
- "column": 21,
- "line": 1,
- "offset": 20,
- },
- "source": "<!--a<!-->",
- "start": {
- "column": 11,
- "line": 1,
- "offset": 10,
- },
- },
- "type": 3,
- },
- ],
- "codegenNode": undefined,
- "isSelfClosing": false,
- "loc": {
- "end": {
- "column": 32,
- "line": 1,
- "offset": 31,
- },
- "source": "<template><!--a<!--></template>",
- "start": {
- "column": 1,
- "line": 1,
- "offset": 0,
- },
- },
- "ns": 0,
- "props": [],
- "tag": "template",
- "tagType": 0,
- "type": 1,
- },
- ],
- "codegenNode": undefined,
- "components": [],
- "directives": [],
- "helpers": Set {},
- "hoists": [],
- "imports": [],
- "loc": {
- "end": {
- "column": 32,
- "line": 1,
- "offset": 31,
- },
- "source": "<template><!--a<!--></template>",
- "start": {
- "column": 1,
- "line": 1,
- "offset": 0,
- },
- },
- "temps": 0,
- "type": 0,
-}
-`;
-
-exports[`compiler: parse > Errors > NESTED_COMMENT > <template><!--a<!--b<!----></template> 1`] = `
-{
- "cached": 0,
- "children": [
- {
- "children": [
- {
- "content": "a<!--b<!--",
- "loc": {
- "end": {
- "column": 28,
- "line": 1,
- "offset": 27,
- },
- "source": "<!--a<!--b<!---->",
- "start": {
- "column": 11,
- "line": 1,
- "offset": 10,
- },
- },
- "type": 3,
- },
- ],
- "codegenNode": undefined,
- "isSelfClosing": false,
- "loc": {
- "end": {
- "column": 39,
- "line": 1,
- "offset": 38,
- },
- "source": "<template><!--a<!--b<!----></template>",
- "start": {
- "column": 1,
- "line": 1,
- "offset": 0,
- },
- },
- "ns": 0,
- "props": [],
- "tag": "template",
- "tagType": 0,
- "type": 1,
- },
- ],
- "codegenNode": undefined,
- "components": [],
- "directives": [],
- "helpers": Set {},
- "hoists": [],
- "imports": [],
- "loc": {
- "end": {
- "column": 39,
- "line": 1,
- "offset": 38,
- },
- "source": "<template><!--a<!--b<!----></template>",
- "start": {
- "column": 1,
- "line": 1,
- "offset": 0,
- },
- },
- "temps": 0,
- "type": 0,
-}
-`;
-
-exports[`compiler: parse > Errors > NESTED_COMMENT > <template><!--a<!--b<!--c--></template> 1`] = `
-{
- "cached": 0,
- "children": [
- {
- "children": [
- {
- "content": "a<!--b<!--c",
- "loc": {
- "end": {
- "column": 29,
- "line": 1,
- "offset": 28,
- },
- "source": "<!--a<!--b<!--c-->",
- "start": {
- "column": 11,
- "line": 1,
- "offset": 10,
- },
- },
- "type": 3,
- },
- ],
- "codegenNode": undefined,
- "isSelfClosing": false,
- "loc": {
- "end": {
- "column": 40,
- "line": 1,
- "offset": 39,
- },
- "source": "<template><!--a<!--b<!--c--></template>",
- "start": {
- "column": 1,
- "line": 1,
- "offset": 0,
- },
- },
- "ns": 0,
- "props": [],
- "tag": "template",
- "tagType": 0,
- "type": 1,
- },
- ],
- "codegenNode": undefined,
- "components": [],
- "directives": [],
- "helpers": Set {},
- "hoists": [],
- "imports": [],
- "loc": {
- "end": {
- "column": 40,
- "line": 1,
- "offset": 39,
- },
- "source": "<template><!--a<!--b<!--c--></template>",
- "start": {
- "column": 1,
- "line": 1,
- "offset": 0,
- },
- },
- "temps": 0,
- "type": 0,
-}
-`;
-
-exports[`compiler: parse > Errors > NESTED_COMMENT > <template><!--a<!--b--></template> 1`] = `
-{
- "cached": 0,
- "children": [
- {
- "children": [
- {
- "content": "a<!--b",
- "loc": {
- "end": {
- "column": 24,
- "line": 1,
- "offset": 23,
- },
- "source": "<!--a<!--b-->",
- "start": {
- "column": 11,
- "line": 1,
- "offset": 10,
- },
- },
- "type": 3,
- },
- ],
- "codegenNode": undefined,
- "isSelfClosing": false,
- "loc": {
- "end": {
- "column": 35,
- "line": 1,
- "offset": 34,
- },
- "source": "<template><!--a<!--b--></template>",
- "start": {
- "column": 1,
- "line": 1,
- "offset": 0,
- },
- },
- "ns": 0,
- "props": [],
- "tag": "template",
- "tagType": 0,
- "type": 1,
- },
- ],
- "codegenNode": undefined,
- "components": [],
- "directives": [],
- "helpers": Set {},
- "hoists": [],
- "imports": [],
- "loc": {
- "end": {
- "column": 35,
- "line": 1,
- "offset": 34,
- },
- "source": "<template><!--a<!--b--></template>",
- "start": {
- "column": 1,
- "line": 1,
- "offset": 0,
- },
- },
- "temps": 0,
- "type": 0,
-}
-`;
-
-exports[`compiler: parse > Errors > UNEXPECTED_CHARACTER_IN_ATTRIBUTE_NAME > <template><div a"bc=''></div></template> 1`] = `
-{
- "cached": 0,
- "children": [
- {
- "children": [
- {
- "children": [],
- "codegenNode": undefined,
- "isSelfClosing": false,
- "loc": {
- "end": {
- "column": 30,
- "line": 1,
- "offset": 29,
- },
- "source": "<div a\\"bc=''></div>",
- "start": {
- "column": 11,
- "line": 1,
- "offset": 10,
- },
- },
- "ns": 0,
- "props": [
- {
- "loc": {
- "end": {
- "column": 23,
- "line": 1,
- "offset": 22,
- },
- "source": "a\\"bc=''",
- "start": {
- "column": 16,
- "line": 1,
- "offset": 15,
- },
- },
- "name": "a\\"bc",
- "type": 6,
- "value": {
- "content": "",
- "loc": {
- "end": {
- "column": 23,
- "line": 1,
- "offset": 22,
- },
- "source": "''",
- "start": {
- "column": 21,
- "line": 1,
- "offset": 20,
- },
- },
- "type": 2,
- },
- },
- ],
- "tag": "div",
- "tagType": 0,
- "type": 1,
- },
- ],
- "codegenNode": undefined,
- "isSelfClosing": false,
- "loc": {
- "end": {
- "column": 41,
- "line": 1,
- "offset": 40,
- },
- "source": "<template><div a\\"bc=''></div></template>",
- "start": {
- "column": 1,
- "line": 1,
- "offset": 0,
- },
- },
- "ns": 0,
- "props": [],
- "tag": "template",
- "tagType": 0,
- "type": 1,
- },
- ],
- "codegenNode": undefined,
- "components": [],
- "directives": [],
- "helpers": Set {},
- "hoists": [],
- "imports": [],
- "loc": {
- "end": {
- "column": 41,
- "line": 1,
- "offset": 40,
- },
- "source": "<template><div a\\"bc=''></div></template>",
- "start": {
- "column": 1,
- "line": 1,
- "offset": 0,
- },
- },
- "temps": 0,
- "type": 0,
-}
-`;
-
-exports[`compiler: parse > Errors > UNEXPECTED_CHARACTER_IN_ATTRIBUTE_NAME > <template><div a'bc=''></div></template> 1`] = `
-{
- "cached": 0,
- "children": [
- {
- "children": [
- {
- "children": [],
- "codegenNode": undefined,
- "isSelfClosing": false,
- "loc": {
- "end": {
- "column": 30,
- "line": 1,
- "offset": 29,
- },
- "source": "<div a'bc=''></div>",
- "start": {
- "column": 11,
- "line": 1,
- "offset": 10,
- },
- },
- "ns": 0,
- "props": [
- {
- "loc": {
- "end": {
- "column": 23,
- "line": 1,
- "offset": 22,
- },
- "source": "a'bc=''",
- "start": {
- "column": 16,
- "line": 1,
- "offset": 15,
- },
- },
- "name": "a'bc",
- "type": 6,
- "value": {
- "content": "",
- "loc": {
- "end": {
- "column": 23,
- "line": 1,
- "offset": 22,
- },
- "source": "''",
- "start": {
- "column": 21,
- "line": 1,
- "offset": 20,
- },
- },
- "type": 2,
- },
- },
- ],
- "tag": "div",
- "tagType": 0,
- "type": 1,
- },
- ],
- "codegenNode": undefined,
- "isSelfClosing": false,
- "loc": {
- "end": {
- "column": 41,
- "line": 1,
- "offset": 40,
- },
- "source": "<template><div a'bc=''></div></template>",
- "start": {
- "column": 1,
- "line": 1,
- "offset": 0,
- },
- },
- "ns": 0,
- "props": [],
- "tag": "template",
- "tagType": 0,
- "type": 1,
- },
- ],
- "codegenNode": undefined,
- "components": [],
- "directives": [],
- "helpers": Set {},
- "hoists": [],
- "imports": [],
- "loc": {
- "end": {
- "column": 41,
- "line": 1,
- "offset": 40,
- },
- "source": "<template><div a'bc=''></div></template>",
- "start": {
- "column": 1,
- "line": 1,
- "offset": 0,
- },
- },
- "temps": 0,
- "type": 0,
-}
-`;
-
-exports[`compiler: parse > Errors > UNEXPECTED_CHARACTER_IN_ATTRIBUTE_NAME > <template><div a<bc=''></div></template> 1`] = `
-{
- "cached": 0,
- "children": [
- {
- "children": [
- {
- "children": [],
- "codegenNode": undefined,
- "isSelfClosing": false,
- "loc": {
- "end": {
- "column": 30,
- "line": 1,
- "offset": 29,
- },
- "source": "<div a<bc=''></div>",
- "start": {
- "column": 11,
- "line": 1,
- "offset": 10,
- },
- },
- "ns": 0,
- "props": [
- {
- "loc": {
- "end": {
- "column": 23,
- "line": 1,
- "offset": 22,
- },
- "source": "a<bc=''",
- "start": {
- "column": 16,
- "line": 1,
- "offset": 15,
- },
- },
- "name": "a<bc",
- "type": 6,
- "value": {
- "content": "",
- "loc": {
- "end": {
- "column": 23,
- "line": 1,
- "offset": 22,
- },
- "source": "''",
- "start": {
- "column": 21,
- "line": 1,
- "offset": 20,
- },
- },
- "type": 2,
- },
- },
- ],
- "tag": "div",
- "tagType": 0,
- "type": 1,
- },
- ],
- "codegenNode": undefined,
- "isSelfClosing": false,
- "loc": {
- "end": {
- "column": 41,
- "line": 1,
- "offset": 40,
- },
- "source": "<template><div a<bc=''></div></template>",
- "start": {
- "column": 1,
- "line": 1,
- "offset": 0,
- },
- },
- "ns": 0,
- "props": [],
- "tag": "template",
- "tagType": 0,
- "type": 1,
- },
- ],
- "codegenNode": undefined,
- "components": [],
- "directives": [],
- "helpers": Set {},
- "hoists": [],
- "imports": [],
- "loc": {
- "end": {
- "column": 41,
- "line": 1,
- "offset": 40,
- },
- "source": "<template><div a<bc=''></div></template>",
- "start": {
- "column": 1,
- "line": 1,
- "offset": 0,
- },
- },
- "temps": 0,
- "type": 0,
-}
-`;
-
-exports[`compiler: parse > Errors > UNEXPECTED_CHARACTER_IN_UNQUOTED_ATTRIBUTE_VALUE > <template><div foo=bar"></div></template> 1`] = `
-{
- "cached": 0,
- "children": [
- {
- "children": [
- {
- "children": [],
- "codegenNode": undefined,
- "isSelfClosing": false,
- "loc": {
- "end": {
- "column": 31,
- "line": 1,
- "offset": 30,
- },
- "source": "<div foo=bar\\"></div>",
- "start": {
- "column": 11,
- "line": 1,
- "offset": 10,
- },
- },
- "ns": 0,
- "props": [
- {
- "loc": {
- "end": {
- "column": 24,
- "line": 1,
- "offset": 23,
- },
- "source": "foo=bar\\"",
- "start": {
- "column": 16,
- "line": 1,
- "offset": 15,
- },
- },
- "name": "foo",
- "type": 6,
- "value": {
- "content": "bar\\"",
- "loc": {
- "end": {
- "column": 24,
- "line": 1,
- "offset": 23,
- },
- "source": "bar\\"",
- "start": {
- "column": 20,
- "line": 1,
- "offset": 19,
- },
- },
- "type": 2,
- },
- },
- ],
- "tag": "div",
- "tagType": 0,
- "type": 1,
- },
- ],
- "codegenNode": undefined,
- "isSelfClosing": false,
- "loc": {
- "end": {
- "column": 42,
- "line": 1,
- "offset": 41,
- },
- "source": "<template><div foo=bar\\"></div></template>",
- "start": {
- "column": 1,
- "line": 1,
- "offset": 0,
- },
- },
- "ns": 0,
- "props": [],
- "tag": "template",
- "tagType": 0,
- "type": 1,
- },
- ],
- "codegenNode": undefined,
- "components": [],
- "directives": [],
- "helpers": Set {},
- "hoists": [],
- "imports": [],
- "loc": {
- "end": {
- "column": 42,
- "line": 1,
- "offset": 41,
- },
- "source": "<template><div foo=bar\\"></div></template>",
- "start": {
- "column": 1,
- "line": 1,
- "offset": 0,
- },
- },
- "temps": 0,
- "type": 0,
-}
-`;
-
-exports[`compiler: parse > Errors > UNEXPECTED_CHARACTER_IN_UNQUOTED_ATTRIBUTE_VALUE > <template><div foo=bar'></div></template> 1`] = `
-{
- "cached": 0,
- "children": [
- {
- "children": [
- {
- "children": [],
- "codegenNode": undefined,
- "isSelfClosing": false,
- "loc": {
- "end": {
- "column": 31,
- "line": 1,
- "offset": 30,
- },
- "source": "<div foo=bar'></div>",
- "start": {
- "column": 11,
- "line": 1,
- "offset": 10,
- },
- },
- "ns": 0,
- "props": [
- {
- "loc": {
- "end": {
- "column": 24,
- "line": 1,
- "offset": 23,
- },
- "source": "foo=bar'",
- "start": {
- "column": 16,
- "line": 1,
- "offset": 15,
- },
- },
- "name": "foo",
- "type": 6,
- "value": {
- "content": "bar'",
- "loc": {
- "end": {
- "column": 24,
- "line": 1,
- "offset": 23,
- },
- "source": "bar'",
- "start": {
- "column": 20,
- "line": 1,
- "offset": 19,
- },
- },
- "type": 2,
- },
- },
- ],
- "tag": "div",
- "tagType": 0,
- "type": 1,
- },
- ],
- "codegenNode": undefined,
- "isSelfClosing": false,
- "loc": {
- "end": {
- "column": 42,
- "line": 1,
- "offset": 41,
- },
- "source": "<template><div foo=bar'></div></template>",
- "start": {
- "column": 1,
- "line": 1,
- "offset": 0,
- },
- },
- "ns": 0,
- "props": [],
- "tag": "template",
- "tagType": 0,
- "type": 1,
- },
- ],
- "codegenNode": undefined,
- "components": [],
- "directives": [],
- "helpers": Set {},
- "hoists": [],
- "imports": [],
- "loc": {
- "end": {
- "column": 42,
- "line": 1,
- "offset": 41,
- },
- "source": "<template><div foo=bar'></div></template>",
- "start": {
- "column": 1,
- "line": 1,
- "offset": 0,
- },
- },
- "temps": 0,
- "type": 0,
-}
-`;
-
-exports[`compiler: parse > Errors > UNEXPECTED_CHARACTER_IN_UNQUOTED_ATTRIBUTE_VALUE > <template><div foo=bar<div></div></template> 1`] = `
-{
- "cached": 0,
- "children": [
- {
- "children": [
- {
- "children": [],
- "codegenNode": undefined,
- "isSelfClosing": false,
- "loc": {
- "end": {
- "column": 34,
- "line": 1,
- "offset": 33,
- },
- "source": "<div foo=bar<div></div>",
- "start": {
- "column": 11,
- "line": 1,
- "offset": 10,
- },
- },
- "ns": 0,
- "props": [
- {
- "loc": {
- "end": {
- "column": 27,
- "line": 1,
- "offset": 26,
- },
- "source": "foo=bar<div",
- "start": {
- "column": 16,
- "line": 1,
- "offset": 15,
- },
- },
- "name": "foo",
- "type": 6,
- "value": {
- "content": "bar<div",
- "loc": {
- "end": {
- "column": 27,
- "line": 1,
- "offset": 26,
- },
- "source": "bar<div",
- "start": {
- "column": 20,
- "line": 1,
- "offset": 19,
- },
- },
- "type": 2,
- },
- },
- ],
- "tag": "div",
- "tagType": 0,
- "type": 1,
- },
- ],
- "codegenNode": undefined,
- "isSelfClosing": false,
- "loc": {
- "end": {
- "column": 45,
- "line": 1,
- "offset": 44,
- },
- "source": "<template><div foo=bar<div></div></template>",
- "start": {
- "column": 1,
- "line": 1,
- "offset": 0,
- },
- },
- "ns": 0,
- "props": [],
- "tag": "template",
- "tagType": 0,
- "type": 1,
- },
- ],
- "codegenNode": undefined,
- "components": [],
- "directives": [],
- "helpers": Set {},
- "hoists": [],
- "imports": [],
- "loc": {
- "end": {
- "column": 45,
- "line": 1,
- "offset": 44,
- },
- "source": "<template><div foo=bar<div></div></template>",
- "start": {
- "column": 1,
- "line": 1,
- "offset": 0,
- },
- },
- "temps": 0,
- "type": 0,
-}
-`;
-
-exports[`compiler: parse > Errors > UNEXPECTED_CHARACTER_IN_UNQUOTED_ATTRIBUTE_VALUE > <template><div foo=bar=baz></div></template> 1`] = `
-{
- "cached": 0,
- "children": [
- {
- "children": [
- {
- "children": [],
- "codegenNode": undefined,
- "isSelfClosing": false,
- "loc": {
- "end": {
- "column": 34,
- "line": 1,
- "offset": 33,
- },
- "source": "<div foo=bar=baz></div>",
- "start": {
- "column": 11,
- "line": 1,
- "offset": 10,
- },
- },
- "ns": 0,
- "props": [
- {
- "loc": {
- "end": {
- "column": 27,
- "line": 1,
- "offset": 26,
- },
- "source": "foo=bar=baz",
- "start": {
- "column": 16,
- "line": 1,
- "offset": 15,
- },
- },
- "name": "foo",
- "type": 6,
- "value": {
- "content": "bar=baz",
- "loc": {
- "end": {
- "column": 27,
- "line": 1,
- "offset": 26,
- },
- "source": "bar=baz",
- "start": {
- "column": 20,
- "line": 1,
- "offset": 19,
- },
- },
- "type": 2,
- },
- },
- ],
- "tag": "div",
- "tagType": 0,
- "type": 1,
- },
- ],
- "codegenNode": undefined,
- "isSelfClosing": false,
- "loc": {
- "end": {
- "column": 45,
- "line": 1,
- "offset": 44,
- },
- "source": "<template><div foo=bar=baz></div></template>",
- "start": {
- "column": 1,
- "line": 1,
- "offset": 0,
- },
- },
- "ns": 0,
- "props": [],
- "tag": "template",
- "tagType": 0,
- "type": 1,
- },
- ],
- "codegenNode": undefined,
- "components": [],
- "directives": [],
- "helpers": Set {},
- "hoists": [],
- "imports": [],
- "loc": {
- "end": {
- "column": 45,
- "line": 1,
- "offset": 44,
- },
- "source": "<template><div foo=bar=baz></div></template>",
- "start": {
- "column": 1,
- "line": 1,
- "offset": 0,
- },
- },
- "temps": 0,
- "type": 0,
-}
-`;
-
-exports[`compiler: parse > Errors > UNEXPECTED_CHARACTER_IN_UNQUOTED_ATTRIBUTE_VALUE > <template><div foo=bar\`></div></template> 1`] = `
-{
- "cached": 0,
- "children": [
- {
- "children": [
- {
- "children": [],
- "codegenNode": undefined,
- "isSelfClosing": false,
- "loc": {
- "end": {
- "column": 31,
- "line": 1,
- "offset": 30,
- },
- "source": "<div foo=bar\`></div>",
- "start": {
- "column": 11,
- "line": 1,
- "offset": 10,
- },
- },
- "ns": 0,
- "props": [
- {
- "loc": {
- "end": {
- "column": 24,
- "line": 1,
- "offset": 23,
- },
- "source": "foo=bar\`",
- "start": {
- "column": 16,
- "line": 1,
- "offset": 15,
- },
- },
- "name": "foo",
- "type": 6,
- "value": {
- "content": "bar\`",
- "loc": {
- "end": {
- "column": 24,
- "line": 1,
- "offset": 23,
- },
- "source": "bar\`",
- "start": {
- "column": 20,
- "line": 1,
- "offset": 19,
- },
- },
- "type": 2,
- },
- },
- ],
- "tag": "div",
- "tagType": 0,
- "type": 1,
- },
- ],
- "codegenNode": undefined,
- "isSelfClosing": false,
- "loc": {
- "end": {
- "column": 42,
- "line": 1,
- "offset": 41,
- },
- "source": "<template><div foo=bar\`></div></template>",
- "start": {
- "column": 1,
- "line": 1,
- "offset": 0,
- },
- },
- "ns": 0,
- "props": [],
- "tag": "template",
- "tagType": 0,
- "type": 1,
- },
- ],
- "codegenNode": undefined,
- "components": [],
- "directives": [],
- "helpers": Set {},
- "hoists": [],
- "imports": [],
- "loc": {
- "end": {
- "column": 42,
- "line": 1,
- "offset": 41,
- },
- "source": "<template><div foo=bar\`></div></template>",
- "start": {
- "column": 1,
- "line": 1,
- "offset": 0,
- },
- },
- "temps": 0,
- "type": 0,
-}
-`;
-
-exports[`compiler: parse > Errors > UNEXPECTED_EQUALS_SIGN_BEFORE_ATTRIBUTE_NAME > <template><div =></div></template> 1`] = `
-{
- "cached": 0,
- "children": [
- {
- "children": [
- {
- "children": [],
- "codegenNode": undefined,
- "isSelfClosing": false,
- "loc": {
- "end": {
- "column": 24,
- "line": 1,
- "offset": 23,
- },
- "source": "<div =></div>",
- "start": {
- "column": 11,
- "line": 1,
- "offset": 10,
- },
- },
- "ns": 0,
- "props": [
- {
- "loc": {
- "end": {
- "column": 17,
- "line": 1,
- "offset": 16,
- },
- "source": "=",
- "start": {
- "column": 16,
- "line": 1,
- "offset": 15,
- },
- },
- "name": "=",
- "type": 6,
- "value": undefined,
- },
- ],
- "tag": "div",
- "tagType": 0,
- "type": 1,
- },
- ],
- "codegenNode": undefined,
- "isSelfClosing": false,
- "loc": {
- "end": {
- "column": 35,
- "line": 1,
- "offset": 34,
- },
- "source": "<template><div =></div></template>",
- "start": {
- "column": 1,
- "line": 1,
- "offset": 0,
- },
- },
- "ns": 0,
- "props": [],
- "tag": "template",
- "tagType": 0,
- "type": 1,
- },
- ],
- "codegenNode": undefined,
- "components": [],
- "directives": [],
- "helpers": Set {},
- "hoists": [],
- "imports": [],
- "loc": {
- "end": {
- "column": 35,
- "line": 1,
- "offset": 34,
- },
- "source": "<template><div =></div></template>",
- "start": {
- "column": 1,
- "line": 1,
- "offset": 0,
- },
- },
- "temps": 0,
- "type": 0,
-}
-`;
-
-exports[`compiler: parse > Errors > UNEXPECTED_EQUALS_SIGN_BEFORE_ATTRIBUTE_NAME > <template><div =foo=bar></div></template> 1`] = `
-{
- "cached": 0,
- "children": [
- {
- "children": [
- {
- "children": [],
- "codegenNode": undefined,
- "isSelfClosing": false,
- "loc": {
- "end": {
- "column": 31,
- "line": 1,
- "offset": 30,
- },
- "source": "<div =foo=bar></div>",
- "start": {
- "column": 11,
- "line": 1,
- "offset": 10,
- },
- },
- "ns": 0,
- "props": [
- {
- "loc": {
- "end": {
- "column": 24,
- "line": 1,
- "offset": 23,
- },
- "source": "=foo=bar",
- "start": {
- "column": 16,
- "line": 1,
- "offset": 15,
- },
- },
- "name": "=foo",
- "type": 6,
- "value": {
- "content": "bar",
- "loc": {
- "end": {
- "column": 24,
- "line": 1,
- "offset": 23,
- },
- "source": "bar",
- "start": {
- "column": 21,
- "line": 1,
- "offset": 20,
- },
- },
- "type": 2,
- },
- },
- ],
- "tag": "div",
- "tagType": 0,
- "type": 1,
- },
- ],
- "codegenNode": undefined,
- "isSelfClosing": false,
- "loc": {
- "end": {
- "column": 42,
- "line": 1,
- "offset": 41,
- },
- "source": "<template><div =foo=bar></div></template>",
- "start": {
- "column": 1,
- "line": 1,
- "offset": 0,
- },
- },
- "ns": 0,
- "props": [],
- "tag": "template",
- "tagType": 0,
- "type": 1,
- },
- ],
- "codegenNode": undefined,
- "components": [],
- "directives": [],
- "helpers": Set {},
- "hoists": [],
- "imports": [],
- "loc": {
- "end": {
- "column": 42,
- "line": 1,
- "offset": 41,
- },
- "source": "<template><div =foo=bar></div></template>",
- "start": {
- "column": 1,
- "line": 1,
- "offset": 0,
- },
- },
- "temps": 0,
- "type": 0,
-}
-`;
-
-exports[`compiler: parse > Errors > UNEXPECTED_QUESTION_MARK_INSTEAD_OF_TAG_NAME > <template><?xml?></template> 1`] = `
-{
- "cached": 0,
- "children": [
- {
- "children": [
- {
- "content": "?xml?",
- "loc": {
- "end": {
- "column": 18,
- "line": 1,
- "offset": 17,
- },
- "source": "<?xml?>",
- "start": {
- "column": 11,
- "line": 1,
- "offset": 10,
- },
- },
- "type": 3,
- },
- ],
- "codegenNode": undefined,
- "isSelfClosing": false,
- "loc": {
- "end": {
- "column": 29,
- "line": 1,
- "offset": 28,
- },
- "source": "<template><?xml?></template>",
- "start": {
- "column": 1,
- "line": 1,
- "offset": 0,
- },
- },
- "ns": 0,
- "props": [],
- "tag": "template",
- "tagType": 0,
- "type": 1,
- },
- ],
- "codegenNode": undefined,
- "components": [],
- "directives": [],
- "helpers": Set {},
- "hoists": [],
- "imports": [],
- "loc": {
- "end": {
- "column": 29,
- "line": 1,
- "offset": 28,
- },
- "source": "<template><?xml?></template>",
- "start": {
- "column": 1,
- "line": 1,
- "offset": 0,
- },
- },
- "temps": 0,
- "type": 0,
-}
-`;
-
-exports[`compiler: parse > Errors > UNEXPECTED_SOLIDUS_IN_TAG > <template><div a/b></div></template> 1`] = `
-{
- "cached": 0,
- "children": [
- {
- "children": [
- {
- "children": [],
- "codegenNode": undefined,
- "isSelfClosing": false,
- "loc": {
- "end": {
- "column": 26,
- "line": 1,
- "offset": 25,
- },
- "source": "<div a/b></div>",
- "start": {
- "column": 11,
- "line": 1,
- "offset": 10,
- },
- },
- "ns": 0,
- "props": [
- {
- "loc": {
- "end": {
- "column": 17,
- "line": 1,
- "offset": 16,
- },
- "source": "a",
- "start": {
- "column": 16,
- "line": 1,
- "offset": 15,
- },
- },
- "name": "a",
- "type": 6,
- "value": undefined,
- },
- {
- "loc": {
- "end": {
- "column": 19,
- "line": 1,
- "offset": 18,
- },
- "source": "b",
- "start": {
- "column": 18,
- "line": 1,
- "offset": 17,
- },
- },
- "name": "b",
- "type": 6,
- "value": undefined,
- },
- ],
- "tag": "div",
- "tagType": 0,
- "type": 1,
- },
- ],
- "codegenNode": undefined,
- "isSelfClosing": false,
- "loc": {
- "end": {
- "column": 37,
- "line": 1,
- "offset": 36,
- },
- "source": "<template><div a/b></div></template>",
- "start": {
- "column": 1,
- "line": 1,
- "offset": 0,
- },
- },
- "ns": 0,
- "props": [],
- "tag": "template",
- "tagType": 0,
- "type": 1,
- },
- ],
- "codegenNode": undefined,
- "components": [],
- "directives": [],
- "helpers": Set {},
- "hoists": [],
- "imports": [],
- "loc": {
- "end": {
- "column": 37,
- "line": 1,
- "offset": 36,
- },
- "source": "<template><div a/b></div></template>",
- "start": {
- "column": 1,
- "line": 1,
- "offset": 0,
- },
- },
- "temps": 0,
- "type": 0,
-}
-`;
-
-exports[`compiler: parse > Errors > X_INVALID_END_TAG > <svg><![CDATA[</div>]]></svg> 1`] = `
-{
- "cached": 0,
- "children": [
- {
- "children": [
- {
- "content": "</div>",
- "loc": {
- "end": {
- "column": 21,
- "line": 1,
- "offset": 20,
- },
- "source": "</div>",
- "start": {
- "column": 15,
- "line": 1,
- "offset": 14,
- },
- },
- "type": 2,
- },
- ],
- "codegenNode": undefined,
- "isSelfClosing": false,
- "loc": {
- "end": {
- "column": 30,
- "line": 1,
- "offset": 29,
- },
- "source": "<svg><![CDATA[</div>]]></svg>",
- "start": {
- "column": 1,
- "line": 1,
- "offset": 0,
- },
- },
- "ns": 1,
- "props": [],
- "tag": "svg",
- "tagType": 0,
- "type": 1,
- },
- ],
- "codegenNode": undefined,
- "components": [],
- "directives": [],
- "helpers": Set {},
- "hoists": [],
- "imports": [],
- "loc": {
- "end": {
- "column": 30,
- "line": 1,
- "offset": 29,
- },
- "source": "<svg><![CDATA[</div>]]></svg>",
- "start": {
- "column": 1,
- "line": 1,
- "offset": 0,
- },
- },
- "temps": 0,
- "type": 0,
-}
-`;
-
-exports[`compiler: parse > Errors > X_INVALID_END_TAG > <svg><!--</div>--></svg> 1`] = `
-{
- "cached": 0,
- "children": [
- {
- "children": [
- {
- "content": "</div>",
- "loc": {
- "end": {
- "column": 19,
- "line": 1,
- "offset": 18,
- },
- "source": "<!--</div>-->",
- "start": {
- "column": 6,
- "line": 1,
- "offset": 5,
- },
- },
- "type": 3,
- },
- ],
- "codegenNode": undefined,
- "isSelfClosing": false,
- "loc": {
- "end": {
- "column": 25,
- "line": 1,
- "offset": 24,
- },
- "source": "<svg><!--</div>--></svg>",
- "start": {
- "column": 1,
- "line": 1,
- "offset": 0,
- },
- },
- "ns": 1,
- "props": [],
- "tag": "svg",
- "tagType": 0,
- "type": 1,
- },
- ],
- "codegenNode": undefined,
- "components": [],
- "directives": [],
- "helpers": Set {},
- "hoists": [],
- "imports": [],
- "loc": {
- "end": {
- "column": 25,
- "line": 1,
- "offset": 24,
- },
- "source": "<svg><!--</div>--></svg>",
- "start": {
- "column": 1,
- "line": 1,
- "offset": 0,
- },
- },
- "temps": 0,
- "type": 0,
-}
-`;
-
-exports[`compiler: parse > Errors > X_INVALID_END_TAG > <template></div></div></template> 1`] = `
-{
- "cached": 0,
- "children": [
- {
- "children": [],
- "codegenNode": undefined,
- "isSelfClosing": false,
- "loc": {
- "end": {
- "column": 34,
- "line": 1,
- "offset": 33,
- },
- "source": "<template></div></div></template>",
- "start": {
- "column": 1,
- "line": 1,
- "offset": 0,
- },
- },
- "ns": 0,
- "props": [],
- "tag": "template",
- "tagType": 0,
- "type": 1,
- },
- ],
- "codegenNode": undefined,
- "components": [],
- "directives": [],
- "helpers": Set {},
- "hoists": [],
- "imports": [],
- "loc": {
- "end": {
- "column": 34,
- "line": 1,
- "offset": 33,
- },
- "source": "<template></div></div></template>",
- "start": {
- "column": 1,
- "line": 1,
- "offset": 0,
- },
- },
- "temps": 0,
- "type": 0,
-}
-`;
-
-exports[`compiler: parse > Errors > X_INVALID_END_TAG > <template></div></template> 1`] = `
-{
- "cached": 0,
- "children": [
- {
- "children": [],
- "codegenNode": undefined,
- "isSelfClosing": false,
- "loc": {
- "end": {
- "column": 28,
- "line": 1,
- "offset": 27,
- },
- "source": "<template></div></template>",
- "start": {
- "column": 1,
- "line": 1,
- "offset": 0,
- },
- },
- "ns": 0,
- "props": [],
- "tag": "template",
- "tagType": 0,
- "type": 1,
- },
- ],
- "codegenNode": undefined,
- "components": [],
- "directives": [],
- "helpers": Set {},
- "hoists": [],
- "imports": [],
- "loc": {
- "end": {
- "column": 28,
- "line": 1,
- "offset": 27,
- },
- "source": "<template></div></template>",
- "start": {
- "column": 1,
- "line": 1,
- "offset": 0,
- },
- },
- "temps": 0,
- "type": 0,
-}
-`;
-
-exports[`compiler: parse > Errors > X_INVALID_END_TAG > <template>{{'</div>'}}</template> 1`] = `
-{
- "cached": 0,
- "children": [
- {
- "children": [
- {
- "content": {
- "constType": 0,
- "content": "'</div>'",
- "isStatic": false,
- "loc": {
- "end": {
- "column": 21,
- "line": 1,
- "offset": 20,
- },
- "source": "'</div>'",
- "start": {
- "column": 13,
- "line": 1,
- "offset": 12,
- },
- },
- "type": 4,
- },
- "loc": {
- "end": {
- "column": 23,
- "line": 1,
- "offset": 22,
- },
- "source": "{{'</div>'}}",
- "start": {
- "column": 11,
- "line": 1,
- "offset": 10,
- },
- },
- "type": 5,
- },
- ],
- "codegenNode": undefined,
- "isSelfClosing": false,
- "loc": {
- "end": {
- "column": 34,
- "line": 1,
- "offset": 33,
- },
- "source": "<template>{{'</div>'}}</template>",
- "start": {
- "column": 1,
- "line": 1,
- "offset": 0,
- },
- },
- "ns": 0,
- "props": [],
- "tag": "template",
- "tagType": 0,
- "type": 1,
- },
- ],
- "codegenNode": undefined,
- "components": [],
- "directives": [],
- "helpers": Set {},
- "hoists": [],
- "imports": [],
- "loc": {
- "end": {
- "column": 34,
- "line": 1,
- "offset": 33,
- },
- "source": "<template>{{'</div>'}}</template>",
- "start": {
- "column": 1,
- "line": 1,
- "offset": 0,
- },
- },
- "temps": 0,
- "type": 0,
-}
-`;
-
-exports[`compiler: parse > Errors > X_INVALID_END_TAG > <textarea></div></textarea> 1`] = `
-{
- "cached": 0,
- "children": [
- {
- "children": [
- {
- "content": "</div>",
- "loc": {
- "end": {
- "column": 17,
- "line": 1,
- "offset": 16,
- },
- "source": "</div>",
- "start": {
- "column": 11,
- "line": 1,
- "offset": 10,
- },
- },
- "type": 2,
- },
- ],
- "codegenNode": undefined,
- "isSelfClosing": false,
- "loc": {
- "end": {
- "column": 28,
- "line": 1,
- "offset": 27,
- },
- "source": "<textarea></div></textarea>",
- "start": {
- "column": 1,
- "line": 1,
- "offset": 0,
- },
- },
- "ns": 0,
- "props": [],
- "tag": "textarea",
- "tagType": 0,
- "type": 1,
- },
- ],
- "codegenNode": undefined,
- "components": [],
- "directives": [],
- "helpers": Set {},
- "hoists": [],
- "imports": [],
- "loc": {
- "end": {
- "column": 28,
- "line": 1,
- "offset": 27,
- },
- "source": "<textarea></div></textarea>",
- "start": {
- "column": 1,
- "line": 1,
- "offset": 0,
- },
- },
- "temps": 0,
- "type": 0,
-}
-`;
-
-exports[`compiler: parse > Errors > X_MISSING_DYNAMIC_DIRECTIVE_ARGUMENT_END > <div v-foo:[sef fsef] /> 1`] = `
-{
- "cached": 0,
- "children": [
- {
- "children": [],
- "codegenNode": undefined,
- "isSelfClosing": true,
- "loc": {
- "end": {
- "column": 25,
- "line": 1,
- "offset": 24,
- },
- "source": "<div v-foo:[sef fsef] />",
- "start": {
- "column": 1,
- "line": 1,
- "offset": 0,
- },
- },
- "ns": 0,
- "props": [
- {
- "arg": {
- "constType": 0,
- "content": "sef",
- "isStatic": false,
- "loc": {
- "end": {
- "column": 16,
- "line": 1,
- "offset": 15,
- },
- "source": "[sef",
- "start": {
- "column": 12,
- "line": 1,
- "offset": 11,
- },
- },
- "type": 4,
- },
- "exp": undefined,
- "loc": {
- "end": {
- "column": 16,
- "line": 1,
- "offset": 15,
- },
- "source": "v-foo:[sef",
- "start": {
- "column": 6,
- "line": 1,
- "offset": 5,
- },
- },
- "modifiers": [],
- "name": "foo",
- "type": 7,
- },
- {
- "loc": {
- "end": {
- "column": 22,
- "line": 1,
- "offset": 21,
- },
- "source": "fsef]",
- "start": {
- "column": 17,
- "line": 1,
- "offset": 16,
- },
- },
- "name": "fsef]",
- "type": 6,
- "value": undefined,
- },
- ],
- "tag": "div",
- "tagType": 0,
- "type": 1,
- },
- ],
- "codegenNode": undefined,
- "components": [],
- "directives": [],
- "helpers": Set {},
- "hoists": [],
- "imports": [],
- "loc": {
- "end": {
- "column": 25,
- "line": 1,
- "offset": 24,
- },
- "source": "<div v-foo:[sef fsef] />",
- "start": {
- "column": 1,
- "line": 1,
- "offset": 0,
- },
- },
- "temps": 0,
- "type": 0,
-}
-`;
-
-exports[`compiler: parse > Errors > X_MISSING_END_TAG > <template><div> 1`] = `
-{
- "cached": 0,
- "children": [
- {
- "children": [
- {
- "children": [],
- "codegenNode": undefined,
- "isSelfClosing": false,
- "loc": {
- "end": {
- "column": 16,
- "line": 1,
- "offset": 15,
- },
- "source": "<div>",
- "start": {
- "column": 11,
- "line": 1,
- "offset": 10,
- },
- },
- "ns": 0,
- "props": [],
- "tag": "div",
- "tagType": 0,
- "type": 1,
- },
- ],
- "codegenNode": undefined,
- "isSelfClosing": false,
- "loc": {
- "end": {
- "column": 16,
- "line": 1,
- "offset": 15,
- },
- "source": "<template><div>",
- "start": {
- "column": 1,
- "line": 1,
- "offset": 0,
- },
- },
- "ns": 0,
- "props": [],
- "tag": "template",
- "tagType": 0,
- "type": 1,
- },
- ],
- "codegenNode": undefined,
- "components": [],
- "directives": [],
- "helpers": Set {},
- "hoists": [],
- "imports": [],
- "loc": {
- "end": {
- "column": 16,
- "line": 1,
- "offset": 15,
- },
- "source": "<template><div>",
- "start": {
- "column": 1,
- "line": 1,
- "offset": 0,
- },
- },
- "temps": 0,
- "type": 0,
-}
-`;
-
-exports[`compiler: parse > Errors > X_MISSING_END_TAG > <template><div></template> 1`] = `
-{
- "cached": 0,
- "children": [
- {
- "children": [
- {
- "children": [],
- "codegenNode": undefined,
- "isSelfClosing": false,
- "loc": {
- "end": {
- "column": 16,
- "line": 1,
- "offset": 15,
- },
- "source": "<div>",
- "start": {
- "column": 11,
- "line": 1,
- "offset": 10,
- },
- },
- "ns": 0,
- "props": [],
- "tag": "div",
- "tagType": 0,
- "type": 1,
- },
- ],
- "codegenNode": undefined,
- "isSelfClosing": false,
- "loc": {
- "end": {
- "column": 27,
- "line": 1,
- "offset": 26,
- },
- "source": "<template><div></template>",
- "start": {
- "column": 1,
- "line": 1,
- "offset": 0,
- },
- },
- "ns": 0,
- "props": [],
- "tag": "template",
- "tagType": 0,
- "type": 1,
- },
- ],
- "codegenNode": undefined,
- "components": [],
- "directives": [],
- "helpers": Set {},
- "hoists": [],
- "imports": [],
- "loc": {
- "end": {
- "column": 27,
- "line": 1,
- "offset": 26,
- },
- "source": "<template><div></template>",
- "start": {
- "column": 1,
- "line": 1,
- "offset": 0,
- },
- },
- "temps": 0,
- "type": 0,
-}
-`;
-
-exports[`compiler: parse > Errors > X_MISSING_INTERPOLATION_END > {{ 1`] = `
-{
- "cached": 0,
- "children": [
- {
- "content": "{{",
- "loc": {
- "end": {
- "column": 3,
- "line": 1,
- "offset": 2,
- },
- "source": "{{",
- "start": {
- "column": 1,
- "line": 1,
- "offset": 0,
- },
- },
- "type": 2,
- },
- ],
- "codegenNode": undefined,
- "components": [],
- "directives": [],
- "helpers": Set {},
- "hoists": [],
- "imports": [],
- "loc": {
- "end": {
- "column": 3,
- "line": 1,
- "offset": 2,
- },
- "source": "{{",
- "start": {
- "column": 1,
- "line": 1,
- "offset": 0,
- },
- },
- "temps": 0,
- "type": 0,
-}
-`;
-
-exports[`compiler: parse > Errors > X_MISSING_INTERPOLATION_END > {{ foo 1`] = `
-{
- "cached": 0,
- "children": [
- {
- "content": "{{ foo",
- "loc": {
- "end": {
- "column": 7,
- "line": 1,
- "offset": 6,
- },
- "source": "{{ foo",
- "start": {
- "column": 1,
- "line": 1,
- "offset": 0,
- },
- },
- "type": 2,
- },
- ],
- "codegenNode": undefined,
- "components": [],
- "directives": [],
- "helpers": Set {},
- "hoists": [],
- "imports": [],
- "loc": {
- "end": {
- "column": 7,
- "line": 1,
- "offset": 6,
- },
- "source": "{{ foo",
- "start": {
- "column": 1,
- "line": 1,
- "offset": 0,
- },
- },
- "temps": 0,
- "type": 0,
-}
-`;
-
-exports[`compiler: parse > Errors > X_MISSING_INTERPOLATION_END > {{}} 1`] = `
-{
- "cached": 0,
- "children": [
- {
- "content": {
- "constType": 0,
- "content": "",
- "isStatic": false,
- "loc": {
- "end": {
- "column": 3,
- "line": 1,
- "offset": 2,
- },
- "source": "",
- "start": {
- "column": 3,
- "line": 1,
- "offset": 2,
- },
- },
- "type": 4,
- },
- "loc": {
- "end": {
- "column": 5,
- "line": 1,
- "offset": 4,
- },
- "source": "{{}}",
- "start": {
- "column": 1,
- "line": 1,
- "offset": 0,
- },
- },
- "type": 5,
- },
- ],
- "codegenNode": undefined,
- "components": [],
- "directives": [],
- "helpers": Set {},
- "hoists": [],
- "imports": [],
- "loc": {
- "end": {
- "column": 5,
- "line": 1,
- "offset": 4,
- },
- "source": "{{}}",
- "start": {
- "column": 1,
- "line": 1,
- "offset": 0,
- },
- },
- "temps": 0,
- "type": 0,
-}
-`;
-
exports[`compiler: parse > invalid html 1`] = `
{
"cached": 0,
{
"children": [],
"codegenNode": undefined,
- "isSelfClosing": true,
"loc": {
"end": {
"column": 37,
"line": 1,
"offset": 36,
},
- "source": "<div :class=\\"{ some: condition }\\" />",
"start": {
"column": 1,
"line": 1,
"line": 1,
"offset": 11,
},
- "source": "class",
"start": {
"column": 7,
"line": 1,
"line": 1,
"offset": 32,
},
- "source": "{ some: condition }",
"start": {
"column": 14,
"line": 1,
"line": 1,
"offset": 33,
},
- "source": ":class=\\"{ some: condition }\\"",
"start": {
"column": 6,
"line": 1,
},
"modifiers": [],
"name": "bind",
+ "rawExp": "{ some: condition }",
+ "rawName": ":class",
"type": 7,
},
],
{
"children": [],
"codegenNode": undefined,
- "isSelfClosing": true,
"loc": {
"end": {
"column": 37,
"line": 2,
"offset": 73,
},
- "source": "<p v-bind:style=\\"{ color: 'red' }\\"/>",
"start": {
"column": 1,
"line": 2,
"line": 2,
"offset": 52,
},
- "source": "style",
"start": {
"column": 11,
"line": 2,
"line": 2,
"offset": 70,
},
- "source": "{ color: 'red' }",
"start": {
"column": 18,
"line": 2,
"line": 2,
"offset": 71,
},
- "source": "v-bind:style=\\"{ color: 'red' }\\"",
"start": {
"column": 4,
"line": 2,
},
"modifiers": [],
"name": "bind",
+ "rawExp": "{ color: 'red' }",
+ "rawName": "v-bind:style",
"type": 7,
},
],
"imports": [],
"loc": {
"end": {
- "column": 37,
- "line": 2,
- "offset": 73,
+ "column": 1,
+ "line": 1,
+ "offset": 0,
},
- "source": "<div :class=\\"{ some: condition }\\" />
-<p v-bind:style=\\"{ color: 'red' }\\"/>",
"start": {
"column": 1,
"line": 1,
"offset": 0,
},
},
+ "source": "<div :class=\\"{ some: condition }\\" />
+<p v-bind:style=\\"{ color: 'red' }\\"/>",
"temps": 0,
"type": 0,
}
{
"children": [],
"codegenNode": undefined,
- "isSelfClosing": true,
"loc": {
"end": {
"column": 39,
"line": 2,
"offset": 73,
},
- "source": "<p v-bind:style=\\"{ color: 'red' }\\"/>",
"start": {
"column": 3,
"line": 2,
"line": 2,
"offset": 52,
},
- "source": "style",
"start": {
"column": 13,
"line": 2,
"line": 2,
"offset": 70,
},
- "source": "{ color: 'red' }",
"start": {
"column": 20,
"line": 2,
"line": 2,
"offset": 71,
},
- "source": "v-bind:style=\\"{ color: 'red' }\\"",
"start": {
"column": 6,
"line": 2,
},
"modifiers": [],
"name": "bind",
+ "rawExp": "{ color: 'red' }",
+ "rawName": "v-bind:style",
"type": 7,
},
],
"line": 3,
"offset": 116,
},
- "source": "<!-- a comment with <html> inside it -->",
"start": {
"column": 3,
"line": 3,
},
],
"codegenNode": undefined,
- "isSelfClosing": false,
"loc": {
"end": {
"column": 7,
"line": 4,
"offset": 123,
},
- "source": "<div :class=\\"{ some: condition }\\">
- <p v-bind:style=\\"{ color: 'red' }\\"/>
- <!-- a comment with <html> inside it -->
-</div>",
"start": {
"column": 1,
"line": 1,
"line": 1,
"offset": 11,
},
- "source": "class",
"start": {
"column": 7,
"line": 1,
"line": 1,
"offset": 32,
},
- "source": "{ some: condition }",
"start": {
"column": 14,
"line": 1,
"line": 1,
"offset": 33,
},
- "source": ":class=\\"{ some: condition }\\"",
"start": {
"column": 6,
"line": 1,
},
"modifiers": [],
"name": "bind",
+ "rawExp": "{ some: condition }",
+ "rawName": ":class",
"type": 7,
},
],
"imports": [],
"loc": {
"end": {
- "column": 7,
- "line": 4,
- "offset": 123,
+ "column": 1,
+ "line": 1,
+ "offset": 0,
},
- "source": "<div :class=\\"{ some: condition }\\">
- <p v-bind:style=\\"{ color: 'red' }\\"/>
- <!-- a comment with <html> inside it -->
-</div>",
"start": {
"column": 1,
"line": 1,
"offset": 0,
},
},
+ "source": "<div :class=\\"{ some: condition }\\">
+ <p v-bind:style=\\"{ color: 'red' }\\"/>
+ <!-- a comment with <html> inside it -->
+</div>",
"temps": 0,
"type": 0,
}
describe('compiler: parse', () => {
describe('Text', () => {
- test.skip('simple text', () => {
+ test('simple text', () => {
const ast = baseParse('some text')
const text = ast.children[0] as TextNode
content: 'some text',
loc: {
start: { offset: 0, line: 1, column: 1 },
- end: { offset: 9, line: 1, column: 10 },
- source: 'some text'
+ end: { offset: 9, line: 1, column: 10 }
}
})
})
content: 'some text',
loc: {
start: { offset: 0, line: 1, column: 1 },
- end: { offset: 9, line: 1, column: 10 },
- source: 'some text'
+ end: { offset: 9, line: 1, column: 10 }
}
})
})
- test.skip('text with interpolation', () => {
+ test('text with interpolation', () => {
const ast = baseParse('some {{ foo + bar }} text')
const text1 = ast.children[0] as TextNode
const text2 = ast.children[2] as TextNode
content: 'some ',
loc: {
start: { offset: 0, line: 1, column: 1 },
- end: { offset: 5, line: 1, column: 6 },
- source: 'some '
+ end: { offset: 5, line: 1, column: 6 }
}
})
expect(text2).toStrictEqual({
content: ' text',
loc: {
start: { offset: 20, line: 1, column: 21 },
- end: { offset: 25, line: 1, column: 26 },
- source: ' text'
+ end: { offset: 25, line: 1, column: 26 }
}
})
})
- test.skip('text with interpolation which has `<`', () => {
+ test('text with interpolation which has `<`', () => {
const ast = baseParse('some {{ a<b && c>d }} text')
const text1 = ast.children[0] as TextNode
const text2 = ast.children[2] as TextNode
content: 'some ',
loc: {
start: { offset: 0, line: 1, column: 1 },
- end: { offset: 5, line: 1, column: 6 },
- source: 'some '
+ end: { offset: 5, line: 1, column: 6 }
}
})
expect(text2).toStrictEqual({
content: ' text',
loc: {
start: { offset: 21, line: 1, column: 22 },
- end: { offset: 26, line: 1, column: 27 },
- source: ' text'
+ end: { offset: 26, line: 1, column: 27 }
}
})
})
- test.skip('text with mix of tags and interpolations', () => {
+ test('text with mix of tags and interpolations', () => {
const ast = baseParse('some <span>{{ foo < bar + foo }} text</span>')
const text1 = ast.children[0] as TextNode
const text2 = (ast.children[1] as ElementNode).children![1] as TextNode
content: 'some ',
loc: {
start: { offset: 0, line: 1, column: 1 },
- end: { offset: 5, line: 1, column: 6 },
- source: 'some '
+ end: { offset: 5, line: 1, column: 6 }
}
})
expect(text2).toStrictEqual({
content: ' text',
loc: {
start: { offset: 32, line: 1, column: 33 },
- end: { offset: 37, line: 1, column: 38 },
- source: ' text'
+ end: { offset: 37, line: 1, column: 38 }
}
})
})
- test.skip('lonely "<" doesn\'t separate nodes', () => {
+ test('lonely "<" doesn\'t separate nodes', () => {
const ast = baseParse('a < b', {
onError: err => {
if (err.code !== ErrorCodes.INVALID_FIRST_CHARACTER_OF_TAG_NAME) {
content: 'a < b',
loc: {
start: { offset: 0, line: 1, column: 1 },
- end: { offset: 5, line: 1, column: 6 },
- source: 'a < b'
+ end: { offset: 5, line: 1, column: 6 }
}
})
})
- test.skip('lonely "{{" doesn\'t separate nodes', () => {
+ test('lonely "{{" doesn\'t separate nodes', () => {
const ast = baseParse('a {{ b', {
onError: error => {
if (error.code !== ErrorCodes.X_MISSING_INTERPOLATION_END) {
content: 'a {{ b',
loc: {
start: { offset: 0, line: 1, column: 1 },
- end: { offset: 6, line: 1, column: 7 },
- source: 'a {{ b'
+ end: { offset: 6, line: 1, column: 7 }
}
})
})
})
describe('Interpolation', () => {
- test.skip('simple interpolation', () => {
+ test('simple interpolation', () => {
const ast = baseParse('{{message}}')
const interpolation = ast.children[0] as InterpolationNode
constType: ConstantTypes.NOT_CONSTANT,
loc: {
start: { offset: 2, line: 1, column: 3 },
- end: { offset: 9, line: 1, column: 10 },
- source: `message`
+ end: { offset: 9, line: 1, column: 10 }
}
},
loc: {
start: { offset: 0, line: 1, column: 1 },
- end: { offset: 11, line: 1, column: 12 },
- source: '{{message}}'
+ end: { offset: 11, line: 1, column: 12 }
}
})
})
- test.skip('it can have tag-like notation', () => {
+ test('it can have tag-like notation', () => {
const ast = baseParse('{{ a<b }}')
const interpolation = ast.children[0] as InterpolationNode
constType: ConstantTypes.NOT_CONSTANT,
loc: {
start: { offset: 3, line: 1, column: 4 },
- end: { offset: 6, line: 1, column: 7 },
- source: 'a<b'
+ end: { offset: 6, line: 1, column: 7 }
}
},
loc: {
start: { offset: 0, line: 1, column: 1 },
- end: { offset: 9, line: 1, column: 10 },
- source: '{{ a<b }}'
+ end: { offset: 9, line: 1, column: 10 }
}
})
})
- test.skip('it can have tag-like notation (2)', () => {
+ test('it can have tag-like notation (2)', () => {
const ast = baseParse('{{ a<b }}{{ c>d }}')
const interpolation1 = ast.children[0] as InterpolationNode
const interpolation2 = ast.children[1] as InterpolationNode
constType: ConstantTypes.NOT_CONSTANT,
loc: {
start: { offset: 3, line: 1, column: 4 },
- end: { offset: 6, line: 1, column: 7 },
- source: 'a<b'
+ end: { offset: 6, line: 1, column: 7 }
}
},
loc: {
start: { offset: 0, line: 1, column: 1 },
- end: { offset: 9, line: 1, column: 10 },
- source: '{{ a<b }}'
+ end: { offset: 9, line: 1, column: 10 }
}
})
content: 'c>d',
loc: {
start: { offset: 12, line: 1, column: 13 },
- end: { offset: 15, line: 1, column: 16 },
- source: 'c>d'
+ end: { offset: 15, line: 1, column: 16 }
}
},
loc: {
start: { offset: 9, line: 1, column: 10 },
- end: { offset: 18, line: 1, column: 19 },
- source: '{{ c>d }}'
+ end: { offset: 18, line: 1, column: 19 }
}
})
})
- test.skip('it can have tag-like notation (3)', () => {
+ test('it can have tag-like notation (3)', () => {
const ast = baseParse('<div>{{ "</div>" }}</div>')
const element = ast.children[0] as ElementNode
const interpolation = element.children[0] as InterpolationNode
content: '"</div>"',
loc: {
start: { offset: 8, line: 1, column: 9 },
- end: { offset: 16, line: 1, column: 17 },
- source: '"</div>"'
+ end: { offset: 16, line: 1, column: 17 }
}
},
loc: {
start: { offset: 5, line: 1, column: 6 },
- end: { offset: 19, line: 1, column: 20 },
- source: '{{ "</div>" }}'
+ end: { offset: 19, line: 1, column: 20 }
}
})
})
- test.skip('custom delimiters', () => {
+ test('custom delimiters', () => {
const ast = baseParse('<p>{msg}</p>', {
delimiters: ['{', '}']
})
constType: ConstantTypes.NOT_CONSTANT,
loc: {
start: { offset: 4, line: 1, column: 5 },
- end: { offset: 7, line: 1, column: 8 },
- source: 'msg'
+ end: { offset: 7, line: 1, column: 8 }
}
},
loc: {
start: { offset: 3, line: 1, column: 4 },
- end: { offset: 8, line: 1, column: 9 },
- source: '{msg}'
+ end: { offset: 8, line: 1, column: 9 }
}
})
})
})
describe('Comment', () => {
- test.skip('empty comment', () => {
+ test('empty comment', () => {
const ast = baseParse('<!---->')
const comment = ast.children[0] as CommentNode
content: '',
loc: {
start: { offset: 0, line: 1, column: 1 },
- end: { offset: 7, line: 1, column: 8 },
- source: '<!---->'
+ end: { offset: 7, line: 1, column: 8 }
}
})
})
- test.skip('simple comment', () => {
+ test('simple comment', () => {
const ast = baseParse('<!--abc-->')
const comment = ast.children[0] as CommentNode
content: 'abc',
loc: {
start: { offset: 0, line: 1, column: 1 },
- end: { offset: 10, line: 1, column: 11 },
- source: '<!--abc-->'
+ end: { offset: 10, line: 1, column: 11 }
}
})
})
- test.skip('two comments', () => {
+ test('two comments', () => {
const ast = baseParse('<!--abc--><!--def-->')
const comment1 = ast.children[0] as CommentNode
const comment2 = ast.children[1] as CommentNode
content: 'abc',
loc: {
start: { offset: 0, line: 1, column: 1 },
- end: { offset: 10, line: 1, column: 11 },
- source: '<!--abc-->'
+ end: { offset: 10, line: 1, column: 11 }
}
})
expect(comment2).toStrictEqual({
content: 'def',
loc: {
start: { offset: 10, line: 1, column: 11 },
- end: { offset: 20, line: 1, column: 21 },
- source: '<!--def-->'
+ end: { offset: 20, line: 1, column: 21 }
}
})
})
- test.skip('comments option', () => {
+ test('comments option', () => {
const astOptionNoComment = baseParse('<!--abc-->', { comments: false })
const astOptionWithComments = baseParse('<!--abc-->', { comments: true })
})
// #2217
- test.skip('comments in the <pre> tag should be removed when comments option requires it', () => {
+ test('comments in the <pre> tag should be removed when comments option requires it', () => {
const rawText = `<p/><!-- foo --><p/>`
const astWithComments = baseParse(`<pre>${rawText}</pre>`, {
})
describe('Element', () => {
- test.skip('simple div', () => {
+ test('simple div', () => {
const ast = baseParse('<div>hello</div>')
const element = ast.children[0] as ElementNode
tagType: ElementTypes.ELEMENT,
codegenNode: undefined,
props: [],
- isSelfClosing: false,
children: [
{
type: NodeTypes.TEXT,
content: 'hello',
loc: {
start: { offset: 5, line: 1, column: 6 },
- end: { offset: 10, line: 1, column: 11 },
- source: 'hello'
+ end: { offset: 10, line: 1, column: 11 }
}
}
],
loc: {
start: { offset: 0, line: 1, column: 1 },
- end: { offset: 16, line: 1, column: 17 },
- source: '<div>hello</div>'
+ end: { offset: 16, line: 1, column: 17 }
}
})
})
- test.skip('empty', () => {
+ test('empty', () => {
const ast = baseParse('<div></div>')
const element = ast.children[0] as ElementNode
tagType: ElementTypes.ELEMENT,
codegenNode: undefined,
props: [],
- isSelfClosing: false,
children: [],
loc: {
start: { offset: 0, line: 1, column: 1 },
- end: { offset: 11, line: 1, column: 12 },
- source: '<div></div>'
+ end: { offset: 11, line: 1, column: 12 }
}
})
})
- test.skip('self closing', () => {
+ test('self closing', () => {
const ast = baseParse('<div/>after')
const element = ast.children[0] as ElementNode
tagType: ElementTypes.ELEMENT,
codegenNode: undefined,
props: [],
-
- isSelfClosing: true,
children: [],
loc: {
start: { offset: 0, line: 1, column: 1 },
- end: { offset: 6, line: 1, column: 7 },
- source: '<div/>'
+ end: { offset: 6, line: 1, column: 7 }
}
})
})
- test.skip('void element', () => {
+ test('void element', () => {
const ast = baseParse('<img>after', {
isVoidTag: tag => tag === 'img'
})
tagType: ElementTypes.ELEMENT,
codegenNode: undefined,
props: [],
-
- isSelfClosing: false,
children: [],
loc: {
start: { offset: 0, line: 1, column: 1 },
- end: { offset: 5, line: 1, column: 6 },
- source: '<img>'
+ end: { offset: 5, line: 1, column: 6 }
}
})
})
- test.skip('template element with directives', () => {
+ test('template element with directives', () => {
const ast = baseParse('<template v-if="ok"></template>')
const element = ast.children[0]
expect(element).toMatchObject({
})
})
- test.skip('template element without directives', () => {
+ test('template element without directives', () => {
const ast = baseParse('<template></template>')
const element = ast.children[0]
expect(element).toMatchObject({
})
})
- test.skip('native element with `isNativeTag`', () => {
+ test('native element with `isNativeTag`', () => {
const ast = baseParse('<div></div><comp></comp><Comp></Comp>', {
isNativeTag: tag => tag === 'div'
})
})
})
- test.skip('native element without `isNativeTag`', () => {
+ test('native element without `isNativeTag`', () => {
const ast = baseParse('<div></div><comp></comp><Comp></Comp>')
expect(ast.children[0]).toMatchObject({
})
})
- test.skip('v-is with `isNativeTag`', () => {
+ test('is casting with `isNativeTag`', () => {
const ast = baseParse(
- `<div></div><div v-is="'foo'"></div><Comp></Comp>`,
+ `<div></div><div is="vue:foo"></div><Comp></Comp>`,
{
isNativeTag: tag => tag === 'div'
}
})
})
- test.skip('v-is without `isNativeTag`', () => {
- const ast = baseParse(`<div></div><div v-is="'foo'"></div><Comp></Comp>`)
+ test('is casting without `isNativeTag`', () => {
+ const ast = baseParse(`<div></div><div is="vue:foo"></div><Comp></Comp>`)
expect(ast.children[0]).toMatchObject({
type: NodeTypes.ELEMENT,
})
})
- test.skip('custom element', () => {
+ test('custom element', () => {
const ast = baseParse('<div></div><comp></comp>', {
isNativeTag: tag => tag === 'div',
isCustomElement: tag => tag === 'comp'
})
})
- test.skip('built-in component', () => {
+ test('built-in component', () => {
const ast = baseParse('<div></div><comp></comp>', {
isBuiltInComponent: tag => (tag === 'comp' ? Symbol() : void 0)
})
})
})
- test.skip('slot element', () => {
+ test('slot element', () => {
const ast = baseParse('<slot></slot><Comp></Comp>')
expect(ast.children[0]).toMatchObject({
})
})
- test.skip('attribute with no value', () => {
+ test('attribute with no value', () => {
const ast = baseParse('<div id></div>')
const element = ast.children[0] as ElementNode
{
type: NodeTypes.ATTRIBUTE,
name: 'id',
+ nameLoc: {
+ start: { offset: 5, line: 1, column: 6 },
+ end: { offset: 7, line: 1, column: 8 }
+ },
value: undefined,
loc: {
start: { offset: 5, line: 1, column: 6 },
- end: { offset: 7, line: 1, column: 8 },
- source: 'id'
+ end: { offset: 7, line: 1, column: 8 }
}
}
],
- isSelfClosing: false,
children: [],
loc: {
start: { offset: 0, line: 1, column: 1 },
- end: { offset: 14, line: 1, column: 15 },
- source: '<div id></div>'
+ end: { offset: 14, line: 1, column: 15 }
}
})
})
- test.skip('attribute with empty value, double quote', () => {
+ test('attribute with empty value, double quote', () => {
const ast = baseParse('<div id=""></div>')
const element = ast.children[0] as ElementNode
{
type: NodeTypes.ATTRIBUTE,
name: 'id',
+ nameLoc: {
+ start: { offset: 5, line: 1, column: 6 },
+ end: { offset: 7, line: 1, column: 8 }
+ },
value: {
type: NodeTypes.TEXT,
content: '',
loc: {
start: { offset: 8, line: 1, column: 9 },
- end: { offset: 10, line: 1, column: 11 },
- source: '""'
+ end: { offset: 10, line: 1, column: 11 }
}
},
loc: {
start: { offset: 5, line: 1, column: 6 },
- end: { offset: 10, line: 1, column: 11 },
- source: 'id=""'
+ end: { offset: 10, line: 1, column: 11 }
}
}
],
- isSelfClosing: false,
children: [],
loc: {
start: { offset: 0, line: 1, column: 1 },
- end: { offset: 17, line: 1, column: 18 },
- source: '<div id=""></div>'
+ end: { offset: 17, line: 1, column: 18 }
}
})
})
- test.skip('attribute with empty value, single quote', () => {
+ test('attribute with empty value, single quote', () => {
const ast = baseParse("<div id=''></div>")
const element = ast.children[0] as ElementNode
{
type: NodeTypes.ATTRIBUTE,
name: 'id',
+ nameLoc: {
+ start: { offset: 5, line: 1, column: 6 },
+ end: { offset: 7, line: 1, column: 8 }
+ },
value: {
type: NodeTypes.TEXT,
content: '',
loc: {
start: { offset: 8, line: 1, column: 9 },
- end: { offset: 10, line: 1, column: 11 },
- source: "''"
+ end: { offset: 10, line: 1, column: 11 }
}
},
loc: {
start: { offset: 5, line: 1, column: 6 },
- end: { offset: 10, line: 1, column: 11 },
- source: "id=''"
+ end: { offset: 10, line: 1, column: 11 }
}
}
],
- isSelfClosing: false,
children: [],
loc: {
start: { offset: 0, line: 1, column: 1 },
- end: { offset: 17, line: 1, column: 18 },
- source: "<div id=''></div>"
+ end: { offset: 17, line: 1, column: 18 }
}
})
})
- test.skip('attribute with value, double quote', () => {
+ test('attribute with value, double quote', () => {
const ast = baseParse('<div id=">\'"></div>')
const element = ast.children[0] as ElementNode
{
type: NodeTypes.ATTRIBUTE,
name: 'id',
+ nameLoc: {
+ start: { offset: 5, line: 1, column: 6 },
+ end: { offset: 7, line: 1, column: 8 }
+ },
value: {
type: NodeTypes.TEXT,
content: ">'",
loc: {
start: { offset: 8, line: 1, column: 9 },
- end: { offset: 12, line: 1, column: 13 },
- source: '">\'"'
+ end: { offset: 12, line: 1, column: 13 }
}
},
loc: {
start: { offset: 5, line: 1, column: 6 },
- end: { offset: 12, line: 1, column: 13 },
- source: 'id=">\'"'
+ end: { offset: 12, line: 1, column: 13 }
}
}
],
- isSelfClosing: false,
children: [],
loc: {
start: { offset: 0, line: 1, column: 1 },
- end: { offset: 19, line: 1, column: 20 },
- source: '<div id=">\'"></div>'
+ end: { offset: 19, line: 1, column: 20 }
}
})
})
- test.skip('attribute with value, single quote', () => {
+ test('attribute with value, single quote', () => {
const ast = baseParse("<div id='>\"'></div>")
const element = ast.children[0] as ElementNode
{
type: NodeTypes.ATTRIBUTE,
name: 'id',
+ nameLoc: {
+ start: { offset: 5, line: 1, column: 6 },
+ end: { offset: 7, line: 1, column: 8 }
+ },
value: {
type: NodeTypes.TEXT,
content: '>"',
loc: {
start: { offset: 8, line: 1, column: 9 },
- end: { offset: 12, line: 1, column: 13 },
- source: "'>\"'"
+ end: { offset: 12, line: 1, column: 13 }
}
},
loc: {
start: { offset: 5, line: 1, column: 6 },
- end: { offset: 12, line: 1, column: 13 },
- source: "id='>\"'"
+ end: { offset: 12, line: 1, column: 13 }
}
}
],
- isSelfClosing: false,
children: [],
loc: {
start: { offset: 0, line: 1, column: 1 },
- end: { offset: 19, line: 1, column: 20 },
- source: "<div id='>\"'></div>"
+ end: { offset: 19, line: 1, column: 20 }
}
})
})
- test.skip('attribute with value, unquoted', () => {
+ test('attribute with value, unquoted', () => {
const ast = baseParse('<div id=a/></div>')
const element = ast.children[0] as ElementNode
{
type: NodeTypes.ATTRIBUTE,
name: 'id',
+ nameLoc: {
+ start: { offset: 5, line: 1, column: 6 },
+ end: { offset: 7, line: 1, column: 8 }
+ },
value: {
type: NodeTypes.TEXT,
content: 'a/',
loc: {
start: { offset: 8, line: 1, column: 9 },
- end: { offset: 10, line: 1, column: 11 },
- source: 'a/'
+ end: { offset: 10, line: 1, column: 11 }
}
},
loc: {
start: { offset: 5, line: 1, column: 6 },
- end: { offset: 10, line: 1, column: 11 },
- source: 'id=a/'
+ end: { offset: 10, line: 1, column: 11 }
}
}
],
- isSelfClosing: false,
children: [],
loc: {
start: { offset: 0, line: 1, column: 1 },
- end: { offset: 17, line: 1, column: 18 },
- source: '<div id=a/></div>'
+ end: { offset: 17, line: 1, column: 18 }
}
})
})
- test.skip('multiple attributes', () => {
+ test('multiple attributes', () => {
const ast = baseParse('<div id=a class="c" inert style=\'\'></div>')
const element = ast.children[0] as ElementNode
{
type: NodeTypes.ATTRIBUTE,
name: 'id',
+ nameLoc: {
+ start: { offset: 5, line: 1, column: 6 },
+ end: { offset: 7, line: 1, column: 8 }
+ },
value: {
type: NodeTypes.TEXT,
content: 'a',
loc: {
start: { offset: 8, line: 1, column: 9 },
- end: { offset: 9, line: 1, column: 10 },
- source: 'a'
+ end: { offset: 9, line: 1, column: 10 }
}
},
loc: {
start: { offset: 5, line: 1, column: 6 },
- end: { offset: 9, line: 1, column: 10 },
- source: 'id=a'
+ end: { offset: 9, line: 1, column: 10 }
}
},
{
type: NodeTypes.ATTRIBUTE,
name: 'class',
+ nameLoc: {
+ start: { offset: 10, line: 1, column: 11 },
+ end: { offset: 15, line: 1, column: 16 }
+ },
value: {
type: NodeTypes.TEXT,
content: 'c',
loc: {
start: { offset: 16, line: 1, column: 17 },
- end: { offset: 19, line: 1, column: 20 },
- source: '"c"'
+ end: { offset: 19, line: 1, column: 20 }
}
},
loc: {
start: { offset: 10, line: 1, column: 11 },
- end: { offset: 19, line: 1, column: 20 },
- source: 'class="c"'
+ end: { offset: 19, line: 1, column: 20 }
}
},
{
type: NodeTypes.ATTRIBUTE,
name: 'inert',
+ nameLoc: {
+ start: { offset: 20, line: 1, column: 21 },
+ end: { offset: 25, line: 1, column: 26 }
+ },
value: undefined,
loc: {
start: { offset: 20, line: 1, column: 21 },
- end: { offset: 25, line: 1, column: 26 },
- source: 'inert'
+ end: { offset: 25, line: 1, column: 26 }
}
},
{
type: NodeTypes.ATTRIBUTE,
name: 'style',
+ nameLoc: {
+ start: { offset: 26, line: 1, column: 27 },
+ end: { offset: 31, line: 1, column: 32 }
+ },
value: {
type: NodeTypes.TEXT,
content: '',
loc: {
start: { offset: 32, line: 1, column: 33 },
- end: { offset: 34, line: 1, column: 35 },
- source: "''"
+ end: { offset: 34, line: 1, column: 35 }
}
},
loc: {
start: { offset: 26, line: 1, column: 27 },
- end: { offset: 34, line: 1, column: 35 },
- source: "style=''"
+ end: { offset: 34, line: 1, column: 35 }
}
}
],
- isSelfClosing: false,
children: [],
loc: {
start: { offset: 0, line: 1, column: 1 },
- end: { offset: 41, line: 1, column: 42 },
- source: '<div id=a class="c" inert style=\'\'></div>'
+ end: { offset: 41, line: 1, column: 42 }
}
})
})
// https://github.com/vuejs/core/issues/4251
- test.skip('class attribute should ignore whitespace when parsed', () => {
+ test('class attribute should ignore whitespace when parsed', () => {
const ast = baseParse('<div class=" \n\t c \t\n "></div>')
const element = ast.children[0] as ElementNode
expect(element).toStrictEqual({
children: [],
codegenNode: undefined,
- isSelfClosing: false,
loc: {
- end: {
- column: 10,
- line: 3,
- offset: 29
- },
- source: '<div class=" \n\t c \t\n "></div>',
- start: {
- column: 1,
- line: 1,
- offset: 0
- }
+ start: { column: 1, line: 1, offset: 0 },
+ end: { column: 10, line: 3, offset: 29 }
},
ns: Namespaces.HTML,
props: [
{
- loc: {
- end: {
- column: 3,
- line: 3,
- offset: 22
- },
- source: 'class=" \n\t c \t\n "',
- start: {
- column: 6,
- line: 1,
- offset: 5
- }
- },
name: 'class',
+ nameLoc: {
+ start: { column: 6, line: 1, offset: 5 },
+ end: { column: 11, line: 1, offset: 10 }
+ },
type: NodeTypes.ATTRIBUTE,
value: {
content: 'c',
loc: {
- end: {
- column: 3,
- line: 3,
- offset: 22
- },
- source: '" \n\t c \t\n "',
- start: {
- column: 12,
- line: 1,
- offset: 11
- }
+ start: { column: 12, line: 1, offset: 11 },
+ end: { column: 3, line: 3, offset: 22 }
},
type: NodeTypes.TEXT
+ },
+ loc: {
+ start: { column: 6, line: 1, offset: 5 },
+ end: { column: 3, line: 3, offset: 22 }
}
}
],
})
})
- test.skip('directive with no value', () => {
+ test('directive with no value', () => {
const ast = baseParse('<div v-if/>')
const directive = (ast.children[0] as ElementNode).props[0]
expect(directive).toStrictEqual({
type: NodeTypes.DIRECTIVE,
name: 'if',
+ rawName: 'v-if',
arg: undefined,
modifiers: [],
exp: undefined,
+ rawExp: undefined,
loc: {
start: { offset: 5, line: 1, column: 6 },
- end: { offset: 9, line: 1, column: 10 },
- source: 'v-if'
+ end: { offset: 9, line: 1, column: 10 }
}
})
})
- test.skip('directive with value', () => {
+ test('directive with value', () => {
const ast = baseParse('<div v-if="a"/>')
const directive = (ast.children[0] as ElementNode).props[0]
expect(directive).toStrictEqual({
type: NodeTypes.DIRECTIVE,
name: 'if',
+ rawName: 'v-if',
arg: undefined,
modifiers: [],
exp: {
constType: ConstantTypes.NOT_CONSTANT,
loc: {
start: { offset: 11, line: 1, column: 12 },
- end: { offset: 12, line: 1, column: 13 },
- source: 'a'
+ end: { offset: 12, line: 1, column: 13 }
}
},
+ rawExp: 'a',
loc: {
start: { offset: 5, line: 1, column: 6 },
- end: { offset: 13, line: 1, column: 14 },
- source: 'v-if="a"'
+ end: { offset: 13, line: 1, column: 14 }
}
})
})
- test.skip('directive with argument', () => {
+ test('directive with argument', () => {
const ast = baseParse('<div v-on:click/>')
const directive = (ast.children[0] as ElementNode).props[0]
expect(directive).toStrictEqual({
type: NodeTypes.DIRECTIVE,
name: 'on',
+ rawName: 'v-on:click',
arg: {
type: NodeTypes.SIMPLE_EXPRESSION,
content: 'click',
isStatic: true,
constType: ConstantTypes.CAN_STRINGIFY,
-
loc: {
- source: 'click',
- start: {
- column: 11,
- line: 1,
- offset: 10
- },
- end: {
- column: 16,
- line: 1,
- offset: 15
- }
+ start: { column: 11, line: 1, offset: 10 },
+ end: { column: 16, line: 1, offset: 15 }
}
},
modifiers: [],
exp: undefined,
+ rawExp: undefined,
loc: {
start: { offset: 5, line: 1, column: 6 },
- end: { offset: 15, line: 1, column: 16 },
- source: 'v-on:click'
+ end: { offset: 15, line: 1, column: 16 }
}
})
})
// #3494
- test.skip('directive argument edge case', () => {
+ test('directive argument edge case', () => {
const ast = baseParse('<div v-slot:slot />')
const directive = (ast.children[0] as ElementNode)
.props[0] as DirectiveNode
expect(directive.arg).toMatchObject({
loc: {
start: { offset: 12, line: 1, column: 13 },
- end: { offset: 16, line: 1, column: 17 },
- source: 'slot'
+ end: { offset: 16, line: 1, column: 17 }
}
})
})
// https://github.com/vuejs/language-tools/issues/2710
- test.skip('directive argument edge case (2)', () => {
+ test('directive argument edge case (2)', () => {
const ast = baseParse('<div #item.item />')
const directive = (ast.children[0] as ElementNode)
.props[0] as DirectiveNode
expect(directive.arg).toMatchObject({
+ content: 'item.item',
loc: {
start: { offset: 6, line: 1, column: 7 },
- end: { offset: 15, line: 1, column: 16 },
- source: 'item.item'
+ end: { offset: 15, line: 1, column: 16 }
}
})
})
- test.skip('directive with dynamic argument', () => {
+ test('directive with dynamic argument', () => {
const ast = baseParse('<div v-on:[event]/>')
const directive = (ast.children[0] as ElementNode).props[0]
expect(directive).toStrictEqual({
type: NodeTypes.DIRECTIVE,
name: 'on',
+ rawName: 'v-on:[event]',
arg: {
type: NodeTypes.SIMPLE_EXPRESSION,
content: 'event',
isStatic: false,
constType: ConstantTypes.NOT_CONSTANT,
-
loc: {
- source: '[event]',
- start: {
- column: 11,
- line: 1,
- offset: 10
- },
- end: {
- column: 18,
- line: 1,
- offset: 17
- }
+ start: { column: 11, line: 1, offset: 10 },
+ end: { column: 18, line: 1, offset: 17 }
}
},
modifiers: [],
exp: undefined,
+ rawExp: undefined,
loc: {
start: { offset: 5, line: 1, column: 6 },
- end: { offset: 17, line: 1, column: 18 },
- source: 'v-on:[event]'
+ end: { offset: 17, line: 1, column: 18 }
}
})
})
- test.skip('directive with a modifier', () => {
+ test('directive with a modifier', () => {
const ast = baseParse('<div v-on.enter/>')
const directive = (ast.children[0] as ElementNode).props[0]
expect(directive).toStrictEqual({
type: NodeTypes.DIRECTIVE,
name: 'on',
+ rawName: 'v-on.enter',
arg: undefined,
modifiers: ['enter'],
exp: undefined,
+ rawExp: undefined,
loc: {
start: { offset: 5, line: 1, column: 6 },
- end: { offset: 15, line: 1, column: 16 },
- source: 'v-on.enter'
+ end: { offset: 15, line: 1, column: 16 }
}
})
})
- test.skip('directive with two modifiers', () => {
+ test('directive with two modifiers', () => {
const ast = baseParse('<div v-on.enter.exact/>')
const directive = (ast.children[0] as ElementNode).props[0]
expect(directive).toStrictEqual({
type: NodeTypes.DIRECTIVE,
name: 'on',
+ rawName: 'v-on.enter.exact',
arg: undefined,
modifiers: ['enter', 'exact'],
exp: undefined,
+ rawExp: undefined,
loc: {
start: { offset: 5, line: 1, column: 6 },
- end: { offset: 21, line: 1, column: 22 },
- source: 'v-on.enter.exact'
+ end: { offset: 21, line: 1, column: 22 }
}
})
})
- test.skip('directive with argument and modifiers', () => {
+ test('directive with argument and modifiers', () => {
const ast = baseParse('<div v-on:click.enter.exact/>')
const directive = (ast.children[0] as ElementNode).props[0]
expect(directive).toStrictEqual({
type: NodeTypes.DIRECTIVE,
name: 'on',
+ rawName: 'v-on:click.enter.exact',
arg: {
type: NodeTypes.SIMPLE_EXPRESSION,
content: 'click',
isStatic: true,
constType: ConstantTypes.CAN_STRINGIFY,
-
loc: {
- source: 'click',
- start: {
- column: 11,
- line: 1,
- offset: 10
- },
- end: {
- column: 16,
- line: 1,
- offset: 15
- }
+ start: { column: 11, line: 1, offset: 10 },
+ end: { column: 16, line: 1, offset: 15 }
}
},
modifiers: ['enter', 'exact'],
exp: undefined,
+ rawExp: undefined,
loc: {
start: { offset: 5, line: 1, column: 6 },
- end: { offset: 27, line: 1, column: 28 },
- source: 'v-on:click.enter.exact'
+ end: { offset: 27, line: 1, column: 28 }
}
})
})
- test.skip('directive with dynamic argument and modifiers', () => {
+ test('directive with dynamic argument and modifiers', () => {
const ast = baseParse('<div v-on:[a.b].camel/>')
const directive = (ast.children[0] as ElementNode).props[0]
expect(directive).toStrictEqual({
type: NodeTypes.DIRECTIVE,
name: 'on',
+ rawName: 'v-on:[a.b].camel',
arg: {
type: NodeTypes.SIMPLE_EXPRESSION,
content: 'a.b',
isStatic: false,
constType: ConstantTypes.NOT_CONSTANT,
-
loc: {
- source: '[a.b]',
- start: {
- column: 11,
- line: 1,
- offset: 10
- },
- end: {
- column: 16,
- line: 1,
- offset: 15
- }
+ start: { column: 11, line: 1, offset: 10 },
+ end: { column: 16, line: 1, offset: 15 }
}
},
modifiers: ['camel'],
exp: undefined,
+ rawExp: undefined,
loc: {
start: { offset: 5, line: 1, column: 6 },
- end: { offset: 21, line: 1, column: 22 },
- source: 'v-on:[a.b].camel'
+ end: { offset: 21, line: 1, column: 22 }
}
})
})
+
test.skip('directive with no name', () => {
let errorCode = -1
const ast = baseParse('<div v-/>', {
value: undefined,
loc: {
start: { offset: 5, line: 1, column: 6 },
- end: { offset: 7, line: 1, column: 8 },
- source: 'v-'
+ end: { offset: 7, line: 1, column: 8 }
}
})
})
- test.skip('v-bind shorthand', () => {
+ test('v-bind shorthand', () => {
const ast = baseParse('<div :a=b />')
const directive = (ast.children[0] as ElementNode).props[0]
expect(directive).toStrictEqual({
type: NodeTypes.DIRECTIVE,
name: 'bind',
+ rawName: ':a',
arg: {
type: NodeTypes.SIMPLE_EXPRESSION,
content: 'a',
isStatic: true,
constType: ConstantTypes.CAN_STRINGIFY,
-
loc: {
- source: 'a',
- start: {
- column: 7,
- line: 1,
- offset: 6
- },
- end: {
- column: 8,
- line: 1,
- offset: 7
- }
+ start: { column: 7, line: 1, offset: 6 },
+ end: { column: 8, line: 1, offset: 7 }
}
},
modifiers: [],
content: 'b',
isStatic: false,
constType: ConstantTypes.NOT_CONSTANT,
-
loc: {
start: { offset: 8, line: 1, column: 9 },
- end: { offset: 9, line: 1, column: 10 },
- source: 'b'
+ end: { offset: 9, line: 1, column: 10 }
}
},
+ rawExp: 'b',
loc: {
start: { offset: 5, line: 1, column: 6 },
- end: { offset: 9, line: 1, column: 10 },
- source: ':a=b'
+ end: { offset: 9, line: 1, column: 10 }
}
})
})
- test.skip('v-bind .prop shorthand', () => {
+ test('v-bind .prop shorthand', () => {
const ast = baseParse('<div .a=b />')
const directive = (ast.children[0] as ElementNode).props[0]
expect(directive).toStrictEqual({
type: NodeTypes.DIRECTIVE,
name: 'bind',
+ rawName: '.a',
arg: {
type: NodeTypes.SIMPLE_EXPRESSION,
content: 'a',
isStatic: true,
constType: ConstantTypes.CAN_STRINGIFY,
-
loc: {
- source: 'a',
- start: {
- column: 7,
- line: 1,
- offset: 6
- },
- end: {
- column: 8,
- line: 1,
- offset: 7
- }
+ start: { column: 7, line: 1, offset: 6 },
+ end: { column: 8, line: 1, offset: 7 }
}
},
modifiers: ['prop'],
content: 'b',
isStatic: false,
constType: ConstantTypes.NOT_CONSTANT,
-
loc: {
start: { offset: 8, line: 1, column: 9 },
- end: { offset: 9, line: 1, column: 10 },
- source: 'b'
+ end: { offset: 9, line: 1, column: 10 }
}
},
+ rawExp: 'b',
loc: {
start: { offset: 5, line: 1, column: 6 },
- end: { offset: 9, line: 1, column: 10 },
- source: '.a=b'
+ end: { offset: 9, line: 1, column: 10 }
}
})
})
- test.skip('v-bind shorthand with modifier', () => {
+ test('v-bind shorthand with modifier', () => {
const ast = baseParse('<div :a.sync=b />')
const directive = (ast.children[0] as ElementNode).props[0]
expect(directive).toStrictEqual({
type: NodeTypes.DIRECTIVE,
name: 'bind',
+ rawName: ':a.sync',
arg: {
type: NodeTypes.SIMPLE_EXPRESSION,
content: 'a',
isStatic: true,
constType: ConstantTypes.CAN_STRINGIFY,
-
loc: {
- source: 'a',
- start: {
- column: 7,
- line: 1,
- offset: 6
- },
- end: {
- column: 8,
- line: 1,
- offset: 7
- }
+ start: { column: 7, line: 1, offset: 6 },
+ end: { column: 8, line: 1, offset: 7 }
}
},
modifiers: ['sync'],
loc: {
start: { offset: 13, line: 1, column: 14 },
- end: { offset: 14, line: 1, column: 15 },
- source: 'b'
+ end: { offset: 14, line: 1, column: 15 }
}
},
+ rawExp: 'b',
loc: {
start: { offset: 5, line: 1, column: 6 },
- end: { offset: 14, line: 1, column: 15 },
- source: ':a.sync=b'
+ end: { offset: 14, line: 1, column: 15 }
}
})
})
- test.skip('v-on shorthand', () => {
+ test('v-on shorthand', () => {
const ast = baseParse('<div @a=b />')
const directive = (ast.children[0] as ElementNode).props[0]
expect(directive).toStrictEqual({
type: NodeTypes.DIRECTIVE,
name: 'on',
+ rawName: '@a',
arg: {
type: NodeTypes.SIMPLE_EXPRESSION,
content: 'a',
isStatic: true,
constType: ConstantTypes.CAN_STRINGIFY,
-
loc: {
- source: 'a',
- start: {
- column: 7,
- line: 1,
- offset: 6
- },
- end: {
- column: 8,
- line: 1,
- offset: 7
- }
+ start: { column: 7, line: 1, offset: 6 },
+ end: { column: 8, line: 1, offset: 7 }
}
},
modifiers: [],
loc: {
start: { offset: 8, line: 1, column: 9 },
- end: { offset: 9, line: 1, column: 10 },
- source: 'b'
+ end: { offset: 9, line: 1, column: 10 }
}
},
+ rawExp: 'b',
loc: {
start: { offset: 5, line: 1, column: 6 },
- end: { offset: 9, line: 1, column: 10 },
- source: '@a=b'
+ end: { offset: 9, line: 1, column: 10 }
}
})
})
- test.skip('v-on shorthand with modifier', () => {
+ test('v-on shorthand with modifier', () => {
const ast = baseParse('<div @a.enter=b />')
const directive = (ast.children[0] as ElementNode).props[0]
expect(directive).toStrictEqual({
type: NodeTypes.DIRECTIVE,
name: 'on',
+ rawName: '@a.enter',
arg: {
type: NodeTypes.SIMPLE_EXPRESSION,
content: 'a',
isStatic: true,
constType: ConstantTypes.CAN_STRINGIFY,
-
loc: {
- source: 'a',
- start: {
- column: 7,
- line: 1,
- offset: 6
- },
- end: {
- column: 8,
- line: 1,
- offset: 7
- }
+ start: { column: 7, line: 1, offset: 6 },
+ end: { column: 8, line: 1, offset: 7 }
}
},
modifiers: ['enter'],
loc: {
start: { offset: 14, line: 1, column: 15 },
- end: { offset: 15, line: 1, column: 16 },
- source: 'b'
+ end: { offset: 15, line: 1, column: 16 }
}
},
+ rawExp: 'b',
loc: {
start: { offset: 5, line: 1, column: 6 },
- end: { offset: 15, line: 1, column: 16 },
- source: '@a.enter=b'
+ end: { offset: 15, line: 1, column: 16 }
}
})
})
- test.skip('v-slot shorthand', () => {
+ test('v-slot shorthand', () => {
const ast = baseParse('<Comp #a="{ b }" />')
const directive = (ast.children[0] as ElementNode).props[0]
expect(directive).toStrictEqual({
type: NodeTypes.DIRECTIVE,
name: 'slot',
+ rawName: '#a',
arg: {
type: NodeTypes.SIMPLE_EXPRESSION,
content: 'a',
isStatic: true,
constType: ConstantTypes.CAN_STRINGIFY,
loc: {
- source: 'a',
- start: {
- column: 8,
- line: 1,
- offset: 7
- },
- end: {
- column: 9,
- line: 1,
- offset: 8
- }
+ start: { column: 8, line: 1, offset: 7 },
+ end: { column: 9, line: 1, offset: 8 }
}
},
modifiers: [],
constType: ConstantTypes.NOT_CONSTANT,
loc: {
start: { offset: 10, line: 1, column: 11 },
- end: { offset: 15, line: 1, column: 16 },
- source: '{ b }'
+ end: { offset: 15, line: 1, column: 16 }
}
},
+ rawExp: '{ b }',
loc: {
start: { offset: 6, line: 1, column: 7 },
- end: { offset: 16, line: 1, column: 17 },
- source: '#a="{ b }"'
+ end: { offset: 16, line: 1, column: 17 }
}
})
})
// #1241 special case for 2.x compat
- test.skip('v-slot arg containing dots', () => {
+ test('v-slot arg containing dots', () => {
const ast = baseParse('<Comp v-slot:foo.bar="{ a }" />')
const directive = (ast.children[0] as ElementNode).props[0]
expect(directive).toMatchObject({
type: NodeTypes.DIRECTIVE,
name: 'slot',
+ rawName: 'v-slot:foo.bar',
arg: {
type: NodeTypes.SIMPLE_EXPRESSION,
content: 'foo.bar',
isStatic: true,
constType: ConstantTypes.CAN_STRINGIFY,
loc: {
- source: 'foo.bar',
start: {
column: 14,
line: 1,
})
})
- test.skip('v-pre', () => {
+ test('v-pre', () => {
const ast = baseParse(
`<div v-pre :id="foo"><Comp/>{{ bar }}</div>\n` +
`<div :id="foo"><Comp/>{{ bar }}</div>`
content: `foo`
},
loc: {
- source: `:id="foo"`,
- start: {
- line: 1,
- column: 12
- },
- end: {
- line: 1,
- column: 21
- }
+ start: { line: 1, column: 12 },
+ end: { line: 1, column: 21 }
}
}
])
content: `foo`
},
loc: {
- source: `:id="foo"`,
start: {
line: 2,
column: 6
})
})
- test.skip('self-closing v-pre', () => {
+ test('self-closing v-pre', () => {
const ast = baseParse(
`<div v-pre/>\n<div :id="foo"><Comp/>{{ bar }}</div>`
)
content: `foo`
},
loc: {
- source: `:id="foo"`,
start: {
line: 2,
column: 6
})
})
- test.skip('end tags are case-insensitive.', () => {
+ test('end tags are case-insensitive.', () => {
const ast = baseParse('<div>hello</DIV>after')
const element = ast.children[0] as ElementNode
const text = element.children[0] as TextNode
content: 'hello',
loc: {
start: { offset: 5, line: 1, column: 6 },
- end: { offset: 10, line: 1, column: 11 },
- source: 'hello'
+ end: { offset: 10, line: 1, column: 11 }
}
})
})
})
- test.skip('self closing single tag', () => {
+ test('self closing single tag', () => {
const ast = baseParse('<div :class="{ some: condition }" />')
expect(ast.children).toHaveLength(1)
expect(ast.children[0]).toMatchObject({ tag: 'div' })
})
- test.skip('self closing multiple tag', () => {
+ test('self closing multiple tag', () => {
const ast = baseParse(
`<div :class="{ some: condition }" />\n` +
`<p v-bind:style="{ color: 'red' }"/>`
expect(ast.children[1]).toMatchObject({ tag: 'p' })
})
- test.skip('valid html', () => {
+ test('valid html', () => {
const ast = baseParse(
`<div :class="{ some: condition }">\n` +
` <p v-bind:style="{ color: 'red' }"/>\n` +
expect(ast).toMatchSnapshot()
})
- test.skip('parse with correct location info', () => {
+ test('parse with correct location info', () => {
const fooSrc = `foo
- is `
+ is `
const barSrc = `{{ bar }}`
const butSrc = ` but `
const bazSrc = `{{ baz }}`
...options
})
- test.skip('should remove whitespaces at start/end inside an element', () => {
+ test('should remove whitespaces at start/end inside an element', () => {
const ast = parse(`<div> <span/> </div>`)
expect((ast.children[0] as ElementNode).children.length).toBe(1)
})
- test.skip('should remove whitespaces w/ newline between elements', () => {
+ test('should remove whitespaces w/ newline between elements', () => {
const ast = parse(`<div/> \n <div/> \n <div/>`)
expect(ast.children.length).toBe(3)
expect(ast.children.every(c => c.type === NodeTypes.ELEMENT)).toBe(true)
})
- test.skip('should remove whitespaces adjacent to comments', () => {
+ test('should remove whitespaces adjacent to comments', () => {
const ast = parse(`<div/> \n <!--foo--> <div/>`)
expect(ast.children.length).toBe(3)
expect(ast.children[0].type).toBe(NodeTypes.ELEMENT)
expect(ast.children[2].type).toBe(NodeTypes.ELEMENT)
})
- test.skip('should remove whitespaces w/ newline between comments and elements', () => {
+ test('should remove whitespaces w/ newline between comments and elements', () => {
const ast = parse(`<div/> \n <!--foo--> \n <div/>`)
expect(ast.children.length).toBe(3)
expect(ast.children[0].type).toBe(NodeTypes.ELEMENT)
expect(ast.children[2].type).toBe(NodeTypes.ELEMENT)
})
- test.skip('should NOT remove whitespaces w/ newline between interpolations', () => {
+ test('should NOT remove whitespaces w/ newline between interpolations', () => {
const ast = parse(`{{ foo }} \n {{ bar }}`)
expect(ast.children.length).toBe(3)
expect(ast.children[0].type).toBe(NodeTypes.INTERPOLATION)
expect(ast.children[2].type).toBe(NodeTypes.INTERPOLATION)
})
- test.skip('should NOT remove whitespaces w/ newline between interpolation and comment', () => {
+ test('should NOT remove whitespaces w/ newline between interpolation and comment', () => {
const ast = parse(`<!-- foo --> \n {{msg}}`)
expect(ast.children.length).toBe(3)
expect(ast.children[0].type).toBe(NodeTypes.COMMENT)
expect(ast.children[2].type).toBe(NodeTypes.INTERPOLATION)
})
- test.skip('should NOT remove whitespaces w/o newline between elements', () => {
+ test('should NOT remove whitespaces w/o newline between elements', () => {
const ast = parse(`<div/> <div/> <div/>`)
expect(ast.children.length).toBe(5)
expect(ast.children.map(c => c.type)).toMatchObject([
])
})
- test.skip('should condense consecutive whitespaces in text', () => {
+ test('should condense consecutive whitespaces in text', () => {
const ast = parse(` foo \n bar baz `)
expect((ast.children[0] as TextNode).content).toBe(` foo bar baz `)
})
- test.skip('should remove leading newline character immediately following the pre element start tag', () => {
+ test('should remove leading newline character immediately following the pre element start tag', () => {
const ast = baseParse(`<pre>\n foo bar </pre>`, {
isPreTag: tag => tag === 'pre'
})
expect((preElement.children[0] as TextNode).content).toBe(` foo bar `)
})
- test.skip('should NOT remove leading newline character immediately following child-tag of pre element', () => {
+ test('should NOT remove leading newline character immediately following child-tag of pre element', () => {
const ast = baseParse(`<pre><span></span>\n foo bar </pre>`, {
isPreTag: tag => tag === 'pre'
})
)
})
- test.skip('self-closing pre tag', () => {
+ test('self-closing pre tag', () => {
const ast = baseParse(`<pre/><span>\n foo bar</span>`, {
isPreTag: tag => tag === 'pre'
})
expect((elementAfterPre.children[0] as TextNode).content).toBe(` foo bar`)
})
- test.skip('should NOT condense whitespaces in RCDATA text mode', () => {
+ test('should NOT condense whitespaces in RCDATA text mode', () => {
const ast = baseParse(`<textarea>Text:\n foo</textarea>`, {
parseMode: 'html'
})
...options
})
- test.skip('should still remove whitespaces at start/end inside an element', () => {
+ test('should still remove whitespaces at start/end inside an element', () => {
const ast = parse(`<div> <span/> </div>`)
expect((ast.children[0] as ElementNode).children.length).toBe(1)
})
- test.skip('should preserve whitespaces w/ newline between elements', () => {
+ test('should preserve whitespaces w/ newline between elements', () => {
const ast = parse(`<div/> \n <div/> \n <div/>`)
expect(ast.children.length).toBe(5)
expect(ast.children.map(c => c.type)).toMatchObject([
])
})
- test.skip('should preserve whitespaces adjacent to comments', () => {
+ test('should preserve whitespaces adjacent to comments', () => {
const ast = parse(`<div/> \n <!--foo--> <div/>`)
expect(ast.children.length).toBe(5)
expect(ast.children.map(c => c.type)).toMatchObject([
])
})
- test.skip('should preserve whitespaces w/ newline between comments and elements', () => {
+ test('should preserve whitespaces w/ newline between comments and elements', () => {
const ast = parse(`<div/> \n <!--foo--> \n <div/>`)
expect(ast.children.length).toBe(5)
expect(ast.children.map(c => c.type)).toMatchObject([
])
})
- test.skip('should preserve whitespaces w/ newline between interpolations', () => {
+ test('should preserve whitespaces w/ newline between interpolations', () => {
const ast = parse(`{{ foo }} \n {{ bar }}`)
expect(ast.children.length).toBe(3)
expect(ast.children[0].type).toBe(NodeTypes.INTERPOLATION)
expect(ast.children[2].type).toBe(NodeTypes.INTERPOLATION)
})
- test.skip('should preserve whitespaces w/o newline between elements', () => {
+ test('should preserve whitespaces w/o newline between elements', () => {
const ast = parse(`<div/> <div/> <div/>`)
expect(ast.children.length).toBe(5)
expect(ast.children.map(c => c.type)).toMatchObject([
])
})
- test.skip('should preserve consecutive whitespaces in text', () => {
+ test('should preserve consecutive whitespaces in text', () => {
const content = ` foo \n bar baz `
const ast = parse(content)
expect((ast.children[0] as TextNode).content).toBe(content)