",
"start": {
"column": 1,
"line": 1,
@@ -3928,6 +4112,7 @@ exports[`compiler: parse > Errors > X_MISSING_INTERPOLATION_END >
{{ foo",
"start": {
"column": 6,
"line": 1,
@@ -3944,6 +4129,7 @@ exports[`compiler: parse > Errors > X_MISSING_INTERPOLATION_END >
{{ foo{{ foo
",
"start": {
"column": 1,
"line": 1,
@@ -3969,6 +4155,7 @@ exports[`compiler: parse > Errors > X_MISSING_INTERPOLATION_END >
{{ foo{{ foo
",
"start": {
"column": 1,
"line": 1,
@@ -3993,6 +4180,7 @@ exports[`compiler: parse > Errors > X_MISSING_INTERPOLATION_END > {{ 1`] = `
"line": 1,
"offset": 2,
},
+ "source": "{{",
"start": {
"column": 1,
"line": 1,
@@ -4014,6 +4202,7 @@ exports[`compiler: parse > Errors > X_MISSING_INTERPOLATION_END > {{ 1`] = `
"line": 1,
"offset": 2,
},
+ "source": "{{",
"start": {
"column": 1,
"line": 1,
@@ -4038,6 +4227,7 @@ exports[`compiler: parse > Errors > X_MISSING_INTERPOLATION_END > {{ foo 1`] = `
"line": 1,
"offset": 6,
},
+ "source": "{{ foo",
"start": {
"column": 1,
"line": 1,
@@ -4059,6 +4249,7 @@ exports[`compiler: parse > Errors > X_MISSING_INTERPOLATION_END > {{ foo 1`] = `
"line": 1,
"offset": 6,
},
+ "source": "{{ foo",
"start": {
"column": 1,
"line": 1,
@@ -4086,6 +4277,7 @@ exports[`compiler: parse > Errors > X_MISSING_INTERPOLATION_END > {{}} 1`] = `
"line": 1,
"offset": 2,
},
+ "source": "",
"start": {
"column": 3,
"line": 1,
@@ -4100,6 +4292,7 @@ exports[`compiler: parse > Errors > X_MISSING_INTERPOLATION_END > {{}} 1`] = `
"line": 1,
"offset": 4,
},
+ "source": "{{}}",
"start": {
"column": 1,
"line": 1,
@@ -4121,6 +4314,7 @@ exports[`compiler: parse > Errors > X_MISSING_INTERPOLATION_END > {{}} 1`] = `
"line": 1,
"offset": 4,
},
+ "source": "{{}}",
"start": {
"column": 1,
"line": 1,
@@ -4148,6 +4342,8 @@ exports[`compiler: parse > invalid html 1`] = `
"line": 3,
"offset": 13,
},
+ "source": "
+",
"start": {
"column": 1,
"line": 2,
@@ -4168,6 +4364,9 @@ exports[`compiler: parse > invalid html 1`] = `
"line": 3,
"offset": 19,
},
+ "source": "
+
+
",
"start": {
"column": 1,
"line": 1,
@@ -4193,6 +4392,10 @@ exports[`compiler: parse > invalid html 1`] = `
"line": 4,
"offset": 27,
},
+ "source": "
+
+
+",
"start": {
"column": 1,
"line": 1,
@@ -4221,6 +4424,7 @@ exports[`compiler: parse > self closing multiple tag 1`] = `
"line": 1,
"offset": 36,
},
+ "source": "
",
"start": {
"column": 1,
"line": 1,
@@ -4240,6 +4444,7 @@ exports[`compiler: parse > self closing multiple tag 1`] = `
"line": 1,
"offset": 11,
},
+ "source": "class",
"start": {
"column": 7,
"line": 1,
@@ -4258,6 +4463,7 @@ exports[`compiler: parse > self closing multiple tag 1`] = `
"line": 1,
"offset": 32,
},
+ "source": "{ some: condition }",
"start": {
"column": 14,
"line": 1,
@@ -4272,6 +4478,7 @@ exports[`compiler: parse > self closing multiple tag 1`] = `
"line": 1,
"offset": 33,
},
+ "source": ":class=\\"{ some: condition }\\"",
"start": {
"column": 6,
"line": 1,
@@ -4298,6 +4505,7 @@ exports[`compiler: parse > self closing multiple tag 1`] = `
"line": 2,
"offset": 73,
},
+ "source": "
",
"start": {
"column": 1,
"line": 2,
@@ -4317,6 +4525,7 @@ exports[`compiler: parse > self closing multiple tag 1`] = `
"line": 2,
"offset": 52,
},
+ "source": "style",
"start": {
"column": 11,
"line": 2,
@@ -4335,6 +4544,7 @@ exports[`compiler: parse > self closing multiple tag 1`] = `
"line": 2,
"offset": 70,
},
+ "source": "{ color: 'red' }",
"start": {
"column": 18,
"line": 2,
@@ -4349,6 +4559,7 @@ exports[`compiler: parse > self closing multiple tag 1`] = `
"line": 2,
"offset": 71,
},
+ "source": "v-bind:style=\\"{ color: 'red' }\\"",
"start": {
"column": 4,
"line": 2,
@@ -4379,6 +4590,8 @@ exports[`compiler: parse > self closing multiple tag 1`] = `
"line": 2,
"offset": 73,
},
+ "source": "
+
",
"start": {
"column": 1,
"line": 1,
@@ -4407,6 +4620,7 @@ exports[`compiler: parse > valid html 1`] = `
"line": 2,
"offset": 73,
},
+ "source": "
",
"start": {
"column": 3,
"line": 2,
@@ -4426,6 +4640,7 @@ exports[`compiler: parse > valid html 1`] = `
"line": 2,
"offset": 52,
},
+ "source": "style",
"start": {
"column": 13,
"line": 2,
@@ -4444,6 +4659,7 @@ exports[`compiler: parse > valid html 1`] = `
"line": 2,
"offset": 70,
},
+ "source": "{ color: 'red' }",
"start": {
"column": 20,
"line": 2,
@@ -4458,6 +4674,7 @@ exports[`compiler: parse > valid html 1`] = `
"line": 2,
"offset": 71,
},
+ "source": "v-bind:style=\\"{ color: 'red' }\\"",
"start": {
"column": 6,
"line": 2,
@@ -4483,6 +4700,7 @@ exports[`compiler: parse > valid html 1`] = `
"line": 3,
"offset": 116,
},
+ "source": "",
"start": {
"column": 3,
"line": 3,
@@ -4499,6 +4717,10 @@ exports[`compiler: parse > valid html 1`] = `
"line": 4,
"offset": 123,
},
+ "source": "
",
"start": {
"column": 1,
"line": 1,
@@ -4518,6 +4740,7 @@ exports[`compiler: parse > valid html 1`] = `
"line": 1,
"offset": 11,
},
+ "source": "class",
"start": {
"column": 7,
"line": 1,
@@ -4536,6 +4759,7 @@ exports[`compiler: parse > valid html 1`] = `
"line": 1,
"offset": 32,
},
+ "source": "{ some: condition }",
"start": {
"column": 14,
"line": 1,
@@ -4550,6 +4774,7 @@ exports[`compiler: parse > valid html 1`] = `
"line": 1,
"offset": 33,
},
+ "source": ":class=\\"{ some: condition }\\"",
"start": {
"column": 6,
"line": 1,
@@ -4580,6 +4805,10 @@ exports[`compiler: parse > valid html 1`] = `
"line": 4,
"offset": 123,
},
+ "source": "
",
"start": {
"column": 1,
"line": 1,
diff --git a/packages/compiler-core/__tests__/parse.spec.ts b/packages/compiler-core/__tests__/parse.spec.ts
index 584644b2d..e0f1d16ed 100644
--- a/packages/compiler-core/__tests__/parse.spec.ts
+++ b/packages/compiler-core/__tests__/parse.spec.ts
@@ -28,7 +28,8 @@ describe('compiler: parse', () => {
content: 'some text',
loc: {
start: { offset: 0, line: 1, column: 1 },
- end: { offset: 9, line: 1, column: 10 }
+ end: { offset: 9, line: 1, column: 10 },
+ source: 'some text'
}
})
})
@@ -55,7 +56,8 @@ describe('compiler: parse', () => {
content: 'some text',
loc: {
start: { offset: 0, line: 1, column: 1 },
- end: { offset: 9, line: 1, column: 10 }
+ end: { offset: 9, line: 1, column: 10 },
+ source: 'some text'
}
})
})
@@ -70,7 +72,8 @@ describe('compiler: parse', () => {
content: 'some ',
loc: {
start: { offset: 0, line: 1, column: 1 },
- end: { offset: 5, line: 1, column: 6 }
+ end: { offset: 5, line: 1, column: 6 },
+ source: 'some '
}
})
expect(text2).toStrictEqual({
@@ -78,7 +81,8 @@ describe('compiler: parse', () => {
content: ' text',
loc: {
start: { offset: 20, line: 1, column: 21 },
- end: { offset: 25, line: 1, column: 26 }
+ end: { offset: 25, line: 1, column: 26 },
+ source: ' text'
}
})
})
@@ -93,7 +97,8 @@ describe('compiler: parse', () => {
content: 'some ',
loc: {
start: { offset: 0, line: 1, column: 1 },
- end: { offset: 5, line: 1, column: 6 }
+ end: { offset: 5, line: 1, column: 6 },
+ source: 'some '
}
})
expect(text2).toStrictEqual({
@@ -101,7 +106,8 @@ describe('compiler: parse', () => {
content: ' text',
loc: {
start: { offset: 21, line: 1, column: 22 },
- end: { offset: 26, line: 1, column: 27 }
+ end: { offset: 26, line: 1, column: 27 },
+ source: ' text'
}
})
})
@@ -116,7 +122,8 @@ describe('compiler: parse', () => {
content: 'some ',
loc: {
start: { offset: 0, line: 1, column: 1 },
- end: { offset: 5, line: 1, column: 6 }
+ end: { offset: 5, line: 1, column: 6 },
+ source: 'some '
}
})
expect(text2).toStrictEqual({
@@ -124,7 +131,8 @@ describe('compiler: parse', () => {
content: ' text',
loc: {
start: { offset: 32, line: 1, column: 33 },
- end: { offset: 37, line: 1, column: 38 }
+ end: { offset: 37, line: 1, column: 38 },
+ source: ' text'
}
})
})
@@ -144,7 +152,8 @@ describe('compiler: parse', () => {
content: 'a < b',
loc: {
start: { offset: 0, line: 1, column: 1 },
- end: { offset: 5, line: 1, column: 6 }
+ end: { offset: 5, line: 1, column: 6 },
+ source: 'a < b'
}
})
})
@@ -164,7 +173,8 @@ describe('compiler: parse', () => {
content: 'a {{ b',
loc: {
start: { offset: 0, line: 1, column: 1 },
- end: { offset: 6, line: 1, column: 7 }
+ end: { offset: 6, line: 1, column: 7 },
+ source: 'a {{ b'
}
})
})
@@ -184,12 +194,14 @@ describe('compiler: parse', () => {
constType: ConstantTypes.NOT_CONSTANT,
loc: {
start: { offset: 2, line: 1, column: 3 },
- end: { offset: 9, line: 1, column: 10 }
+ end: { offset: 9, line: 1, column: 10 },
+ source: 'message'
}
},
loc: {
start: { offset: 0, line: 1, column: 1 },
- end: { offset: 11, line: 1, column: 12 }
+ end: { offset: 11, line: 1, column: 12 },
+ source: '{{message}}'
}
})
})
@@ -207,12 +219,14 @@ describe('compiler: parse', () => {
constType: ConstantTypes.NOT_CONSTANT,
loc: {
start: { offset: 3, line: 1, column: 4 },
- end: { offset: 6, line: 1, column: 7 }
+ end: { offset: 6, line: 1, column: 7 },
+ source: 'a
{
constType: ConstantTypes.NOT_CONSTANT,
loc: {
start: { offset: 3, line: 1, column: 4 },
- end: { offset: 6, line: 1, column: 7 }
+ end: { offset: 6, line: 1, column: 7 },
+ source: 'a {
content: 'c>d',
loc: {
start: { offset: 12, line: 1, column: 13 },
- end: { offset: 15, line: 1, column: 16 }
+ end: { offset: 15, line: 1, column: 16 },
+ source: 'c>d'
}
},
loc: {
start: { offset: 9, line: 1, column: 10 },
- end: { offset: 18, line: 1, column: 19 }
+ end: { offset: 18, line: 1, column: 19 },
+ source: '{{ c>d }}'
}
})
})
@@ -274,12 +292,14 @@ describe('compiler: parse', () => {
content: '""',
loc: {
start: { offset: 8, line: 1, column: 9 },
- end: { offset: 16, line: 1, column: 17 }
+ end: { offset: 16, line: 1, column: 17 },
+ source: '"