toDisplayString,
normalizeClass,
normalizeStyle,
- stringifyStyle
+ stringifyStyle,
+ makeMap
} from '@vue/shared'
export const enum StringifyThresholds {
context.hoists[context.hoists.indexOf(hoistToReplace)] = replacement
}
+const isNonStringifiable = /*#__PURE__*/ makeMap(`thead,tr,th,tbody,td`)
+
/**
* for a hoisted node, analyze it and return:
* - false: bailed (contains runtime constant)
* - ec is the number of element with bindings inside
*/
function analyzeNode(node: StringifiableNode): [number, number] | false {
+ if (node.type === NodeTypes.ELEMENT && isNonStringifiable(node.tag)) {
+ return false
+ }
+
if (node.type === NodeTypes.TEXT_CALL) {
return [1, 0]
}
-// Make a map and return a function for checking if a key
-// is in that map.
-//
-// IMPORTANT: all calls of this function must be prefixed with /*#__PURE__*/
-// So that rollup can tree-shake them if necessary.
+/**
+ * Make a map and return a function for checking if a key
+ * is in that map.
+ * IMPORTANT: all calls of this function must be prefixed with
+ * \/\*#\_\_PURE\_\_\*\/
+ * So that rollup can tree-shake them if necessary.
+ */
export function makeMap(
str: string,
expectsLowerCase?: boolean