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": [],
|
"children": [],
|
||||||
"codegenNode": undefined,
|
"codegenNode": undefined,
|
||||||
|
"isSelfClosing": true,
|
||||||
"loc": {
|
"loc": {
|
||||||
"end": {
|
"end": {
|
||||||
"column": 25,
|
"column": 25,
|
||||||
|
@ -4417,6 +4418,7 @@ exports[`compiler: parse > self closing multiple tag 1`] = `
|
||||||
{
|
{
|
||||||
"children": [],
|
"children": [],
|
||||||
"codegenNode": undefined,
|
"codegenNode": undefined,
|
||||||
|
"isSelfClosing": true,
|
||||||
"loc": {
|
"loc": {
|
||||||
"end": {
|
"end": {
|
||||||
"column": 37,
|
"column": 37,
|
||||||
|
@ -4497,6 +4499,7 @@ exports[`compiler: parse > self closing multiple tag 1`] = `
|
||||||
{
|
{
|
||||||
"children": [],
|
"children": [],
|
||||||
"codegenNode": undefined,
|
"codegenNode": undefined,
|
||||||
|
"isSelfClosing": true,
|
||||||
"loc": {
|
"loc": {
|
||||||
"end": {
|
"end": {
|
||||||
"column": 37,
|
"column": 37,
|
||||||
|
@ -4611,6 +4614,7 @@ exports[`compiler: parse > valid html 1`] = `
|
||||||
{
|
{
|
||||||
"children": [],
|
"children": [],
|
||||||
"codegenNode": undefined,
|
"codegenNode": undefined,
|
||||||
|
"isSelfClosing": true,
|
||||||
"loc": {
|
"loc": {
|
||||||
"end": {
|
"end": {
|
||||||
"column": 39,
|
"column": 39,
|
||||||
|
|
|
@ -501,6 +501,7 @@ describe('compiler: parse', () => {
|
||||||
codegenNode: undefined,
|
codegenNode: undefined,
|
||||||
props: [],
|
props: [],
|
||||||
children: [],
|
children: [],
|
||||||
|
isSelfClosing: true,
|
||||||
loc: {
|
loc: {
|
||||||
start: { offset: 0, line: 1, column: 1 },
|
start: { offset: 0, line: 1, column: 1 },
|
||||||
end: { offset: 6, line: 1, column: 7 },
|
end: { offset: 6, line: 1, column: 7 },
|
||||||
|
@ -545,6 +546,7 @@ describe('compiler: parse', () => {
|
||||||
codegenNode: undefined,
|
codegenNode: undefined,
|
||||||
props: [],
|
props: [],
|
||||||
children: [],
|
children: [],
|
||||||
|
isSelfClosing: true,
|
||||||
loc: {
|
loc: {
|
||||||
start: { offset: 0, line: 1, column: 1 },
|
start: { offset: 0, line: 1, column: 1 },
|
||||||
end: { offset: 6, line: 1, column: 7 },
|
end: { offset: 6, line: 1, column: 7 },
|
||||||
|
|
|
@ -131,6 +131,7 @@ export interface BaseElementNode extends Node {
|
||||||
tagType: ElementTypes
|
tagType: ElementTypes
|
||||||
props: Array<AttributeNode | DirectiveNode>
|
props: Array<AttributeNode | DirectiveNode>
|
||||||
children: TemplateChildNode[]
|
children: TemplateChildNode[]
|
||||||
|
isSelfClosing?: boolean
|
||||||
innerLoc?: SourceLocation // only for SFC root level elements
|
innerLoc?: SourceLocation // only for SFC root level elements
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -172,6 +172,7 @@ const tokenizer = new Tokenizer(stack, {
|
||||||
|
|
||||||
onselfclosingtag(end) {
|
onselfclosingtag(end) {
|
||||||
const name = currentOpenTag!.tag
|
const name = currentOpenTag!.tag
|
||||||
|
currentOpenTag!.isSelfClosing = true
|
||||||
endOpenTag(end)
|
endOpenTag(end)
|
||||||
if (stack[0]?.tag === name) {
|
if (stack[0]?.tag === name) {
|
||||||
onCloseTag(stack.shift()!, end)
|
onCloseTag(stack.shift()!, end)
|
||||||
|
|
Loading…
Reference in New Issue