mirror of https://github.com/vuejs/core.git
refactor: restore isSelfClosing as optional property
This commit is contained in:
parent
bab5bd375b
commit
157cfcb796
|
@ -3831,6 +3831,7 @@ exports[`compiler: parse > Errors > X_MISSING_DYNAMIC_DIRECTIVE_ARGUMENT_END > <
|
|||
{
|
||||
"children": [],
|
||||
"codegenNode": undefined,
|
||||
"isSelfClosing": true,
|
||||
"loc": {
|
||||
"end": {
|
||||
"column": 25,
|
||||
|
@ -4417,6 +4418,7 @@ exports[`compiler: parse > self closing multiple tag 1`] = `
|
|||
{
|
||||
"children": [],
|
||||
"codegenNode": undefined,
|
||||
"isSelfClosing": true,
|
||||
"loc": {
|
||||
"end": {
|
||||
"column": 37,
|
||||
|
@ -4497,6 +4499,7 @@ exports[`compiler: parse > self closing multiple tag 1`] = `
|
|||
{
|
||||
"children": [],
|
||||
"codegenNode": undefined,
|
||||
"isSelfClosing": true,
|
||||
"loc": {
|
||||
"end": {
|
||||
"column": 37,
|
||||
|
@ -4611,6 +4614,7 @@ exports[`compiler: parse > valid html 1`] = `
|
|||
{
|
||||
"children": [],
|
||||
"codegenNode": undefined,
|
||||
"isSelfClosing": true,
|
||||
"loc": {
|
||||
"end": {
|
||||
"column": 39,
|
||||
|
|
|
@ -501,6 +501,7 @@ describe('compiler: parse', () => {
|
|||
codegenNode: undefined,
|
||||
props: [],
|
||||
children: [],
|
||||
isSelfClosing: true,
|
||||
loc: {
|
||||
start: { offset: 0, line: 1, column: 1 },
|
||||
end: { offset: 6, line: 1, column: 7 },
|
||||
|
@ -545,6 +546,7 @@ describe('compiler: parse', () => {
|
|||
codegenNode: undefined,
|
||||
props: [],
|
||||
children: [],
|
||||
isSelfClosing: true,
|
||||
loc: {
|
||||
start: { offset: 0, line: 1, column: 1 },
|
||||
end: { offset: 6, line: 1, column: 7 },
|
||||
|
|
|
@ -131,6 +131,7 @@ export interface BaseElementNode extends Node {
|
|||
tagType: ElementTypes
|
||||
props: Array<AttributeNode | DirectiveNode>
|
||||
children: TemplateChildNode[]
|
||||
isSelfClosing?: boolean
|
||||
innerLoc?: SourceLocation // only for SFC root level elements
|
||||
}
|
||||
|
||||
|
|
|
@ -172,6 +172,7 @@ const tokenizer = new Tokenizer(stack, {
|
|||
|
||||
onselfclosingtag(end) {
|
||||
const name = currentOpenTag!.tag
|
||||
currentOpenTag!.isSelfClosing = true
|
||||
endOpenTag(end)
|
||||
if (stack[0]?.tag === name) {
|
||||
onCloseTag(stack.shift()!, end)
|
||||
|
|
Loading…
Reference in New Issue