@@ -179,7 +179,7 @@ const tokenizer = new Tokenizer(stack, {
179
179
const name = currentOpenTag ! . tag
180
180
currentOpenTag ! . isSelfClosing = true
181
181
endOpenTag ( end )
182
- if ( stack [ 0 ] ? .tag === name ) {
182
+ if ( stack [ 0 ] && stack [ 0 ] . tag === name ) {
183
183
onCloseTag ( stack . shift ( ) ! , end )
184
184
}
185
185
} ,
@@ -587,14 +587,14 @@ function endOpenTag(end: number) {
587
587
588
588
function onText ( content : string , start : number , end : number ) {
589
589
if ( __BROWSER__ ) {
590
- const tag = stack [ 0 ] ? .tag
590
+ const tag = stack [ 0 ] && stack [ 0 ] . tag
591
591
if ( tag !== 'script' && tag !== 'style' && content . includes ( '&' ) ) {
592
592
content = currentOptions . decodeEntities ! ( content , false )
593
593
}
594
594
}
595
595
const parent = stack [ 0 ] || currentRoot
596
596
const lastNode = parent . children [ parent . children . length - 1 ]
597
- if ( lastNode ? .type === NodeTypes . TEXT ) {
597
+ if ( lastNode && lastNode . type === NodeTypes . TEXT ) {
598
598
// merge
599
599
lastNode . content += content
600
600
setLocEnd ( lastNode . loc , end )
@@ -771,7 +771,8 @@ function isComponent({ tag, props }: ElementNode): boolean {
771
771
tag === 'component' ||
772
772
isUpperCase ( tag . charCodeAt ( 0 ) ) ||
773
773
isCoreComponent ( tag ) ||
774
- currentOptions . isBuiltInComponent ?.( tag ) ||
774
+ ( currentOptions . isBuiltInComponent &&
775
+ currentOptions . isBuiltInComponent ( tag ) ) ||
775
776
( currentOptions . isNativeTag && ! currentOptions . isNativeTag ( tag ) )
776
777
) {
777
778
return true
@@ -828,8 +829,8 @@ function condenseWhitespace(
828
829
if ( node . type === NodeTypes . TEXT ) {
829
830
if ( ! inPre ) {
830
831
if ( isAllWhitespace ( node . content ) ) {
831
- const prev = nodes [ i - 1 ] ? .type
832
- const next = nodes [ i + 1 ] ? .type
832
+ const prev = nodes [ i - 1 ] && nodes [ i - 1 ] . type
833
+ const next = nodes [ i + 1 ] && nodes [ i + 1 ] . type
833
834
// Remove if:
834
835
// - the whitespace is the first or last node, or:
835
836
// - (condense mode) the whitespace is between two comments, or:
@@ -1063,7 +1064,7 @@ export function baseParse(input: string, options?: ParserOptions): RootNode {
1063
1064
currentOptions . ns === Namespaces . SVG ||
1064
1065
currentOptions . ns === Namespaces . MATH_ML
1065
1066
1066
- const delimiters = options ? .delimiters
1067
+ const delimiters = options && options . delimiters
1067
1068
if ( delimiters ) {
1068
1069
tokenizer . delimiterOpen = toCharCodes ( delimiters [ 0 ] )
1069
1070
tokenizer . delimiterClose = toCharCodes ( delimiters [ 1 ] )
0 commit comments