wip: tests for compiler compat

This commit is contained in:
Evan You
2021-04-30 15:50:32 -04:00
parent b4c92ccf6b
commit bd3cc4d2c7
9 changed files with 271 additions and 79 deletions

View File

@@ -41,8 +41,7 @@ import {
TELEPORT,
KEEP_ALIVE,
SUSPENSE,
UNREF,
FRAGMENT
UNREF
} from '../runtimeHelpers'
import {
getInnerRange,
@@ -92,19 +91,6 @@ export const transformElement: NodeTransform = (node, context) => {
? resolveComponentType(node as ComponentNode, context)
: `"${tag}"`
// 2.x <template> with no directives compat
if (
__COMPAT__ &&
tag === 'template' &&
checkCompatEnabled(
CompilerDeprecationTypes.COMPILER_NATIVE_TEMPLATE,
context,
node.loc
)
) {
vnodeTag = context.helper(FRAGMENT)
}
const isDynamicComponent =
isObject(vnodeTag) && vnodeTag.callee === RESOLVE_DYNAMIC_COMPONENT