]> git.ipfire.org Git - thirdparty/vuejs/core.git/commitdiff
wip(vitest-migration): compiler-dom tests passing
authorEvan You <yyx990803@gmail.com>
Thu, 26 Jan 2023 08:48:19 +0000 (16:48 +0800)
committerEvan You <yyx990803@gmail.com>
Thu, 26 Jan 2023 08:48:19 +0000 (16:48 +0800)
packages/compiler-dom/__tests__/__snapshots__/index.spec.ts.snap
packages/compiler-dom/__tests__/decoderHtmlBrowser.spec.ts
packages/compiler-dom/__tests__/transforms/__snapshots__/Transition.spec.ts.snap
packages/compiler-dom/__tests__/transforms/__snapshots__/stringifyStatic.spec.ts.snap
packages/compiler-dom/__tests__/transforms/__snapshots__/vModel.spec.ts.snap
packages/compiler-dom/__tests__/transforms/__snapshots__/vShow.spec.ts.snap
packages/compiler-dom/src/errors.ts
packages/compiler-dom/src/parserOptions.ts

index 2cc7a3bfb144d4500b7e0770b8c07d34d78f6b24..3d19bdcc052364ef3c9e25a809b5efab973faf96 100644 (file)
@@ -1,6 +1,6 @@
-// Jest Snapshot v1, https://goo.gl/fbAQLP
+// Vitest Snapshot v1
 
-exports[`compile should contain standard transforms 1`] = `
+exports[`compile should contain standard transforms 1`] = `
 "const _Vue = Vue
 
 return function render(_ctx, _cache) {
@@ -8,13 +8,13 @@ return function render(_ctx, _cache) {
     const { toDisplayString: _toDisplayString, createElementVNode: _createElementVNode, normalizeStyle: _normalizeStyle, Fragment: _Fragment, openBlock: _openBlock, createElementBlock: _createElementBlock } = _Vue
 
     return (_openBlock(), _createElementBlock(_Fragment, null, [
-      _createElementVNode("div", {
+      _createElementVNode(\\"div\\", {
         textContent: _toDisplayString(text)
-      }, null, 8 /* PROPS */, ["textContent"]),
-      _createElementVNode("div", { innerHTML: html }, null, 8 /* PROPS */, ["innerHTML"]),
-      _createElementVNode("div", null, "test"),
-      _createElementVNode("div", { style: {"color":"red"} }, "red"),
-      _createElementVNode("div", {
+      }, null, 8 /* PROPS */, [\\"textContent\\"]),
+      _createElementVNode(\\"div\\", { innerHTML: html }, null, 8 /* PROPS */, [\\"innerHTML\\"]),
+      _createElementVNode(\\"div\\", null, \\"test\\"),
+      _createElementVNode(\\"div\\", { style: {\\"color\\":\\"red\\"} }, \\"red\\"),
+      _createElementVNode(\\"div\\", {
         style: _normalizeStyle({color: 'green'})
       }, null, 4 /* STYLE */)
     ], 64 /* STABLE_FRAGMENT */))
index 9100927defdbf52cdfa5bf382cea0e52c558f5cc..03c0929dbe26b437677871aa7a99b9123f38fe13 100644 (file)
@@ -1,3 +1,6 @@
+/**
+ * @vitest-environment jsdom
+ */
 import { decodeHtmlBrowser } from '../src/decodeHtmlBrowser'
 
 describe('decodeHtmlBrowser', () => {
index 8396cb7ff5b8f5fac76e947e733242a9f892cdb0..6a4e9e50a4d044b3001aaec2c3487e378aadaf5b 100644 (file)
@@ -1,4 +1,4 @@
-// Jest Snapshot v1, https://goo.gl/fbAQLP
+// Vitest Snapshot v1
 
 exports[`inject persisted when child has v-show 1`] = `
 "const _Vue = Vue
@@ -7,9 +7,9 @@ return function render(_ctx, _cache) {
   with (_ctx) {
     const { vShow: _vShow, createElementVNode: _createElementVNode, withDirectives: _withDirectives, Transition: _Transition, withCtx: _withCtx, openBlock: _openBlock, createBlock: _createBlock } = _Vue
 
-    return (_openBlock(), _createBlock(_Transition, { persisted: "" }, {
+    return (_openBlock(), _createBlock(_Transition, { persisted: \\"\\" }, {
       default: _withCtx(() => [
-        _withDirectives(_createElementVNode("div", null, null, 512 /* NEED_PATCH */), [
+        _withDirectives(_createElementVNode(\\"div\\", null, null, 512 /* NEED_PATCH */), [
           [_vShow, ok]
         ])
       ]),
@@ -29,15 +29,15 @@ return function render(_ctx, _cache) {
     return (_openBlock(), _createBlock(_Transition, null, {
       default: _withCtx(() => [
         a
-          ? (_openBlock(), _createElementBlock("div", { key: 0 }, "hey"))
+          ? (_openBlock(), _createElementBlock(\\"div\\", { key: 0 }, \\"hey\\"))
           : b
-            ? (_openBlock(), _createElementBlock("div", { key: 1 }, "hey"))
-            : (_openBlock(), _createElementBlock("div", { key: 2 }, [
+            ? (_openBlock(), _createElementBlock(\\"div\\", { key: 1 }, \\"hey\\"))
+            : (_openBlock(), _createElementBlock(\\"div\\", { key: 2 }, [
                 c
-                  ? (_openBlock(), _createElementBlock("p", { key: 0 }))
+                  ? (_openBlock(), _createElementBlock(\\"p\\", { key: 0 }))
                   : (_openBlock(), _createElementBlock(_Fragment, { key: 1 }, [
-                      _createCommentVNode(" this should not be ignored "),
-                      _createElementVNode("p")
+                      _createCommentVNode(\\" this should not be ignored \\"),
+                      _createElementVNode(\\"p\\")
                     ], 2112 /* STABLE_FRAGMENT, DEV_ROOT_FRAGMENT */))
               ]))
       ]),
index 176004794c9215a99c4118460ad965c5401b7331..74ab708abbc5e0ae060c38f8e9009c93f754e069 100644 (file)
@@ -1,52 +1,52 @@
-// Jest Snapshot v1, https://goo.gl/fbAQLP
+// Vitest Snapshot v1
 
-exports[`stringify static html should bail on bindings that are hoisted but not stringifiable 1`] = `
+exports[`stringify static html should bail on bindings that are hoisted but not stringifiable 1`] = `
 "const { createElementVNode: _createElementVNode, openBlock: _openBlock, createElementBlock: _createElementBlock } = Vue
 
-const _hoisted_1 = /*#__PURE__*/_createElementVNode("div", null, [
-  /*#__PURE__*/_createElementVNode("span", { class: "foo" }, "foo"),
-  /*#__PURE__*/_createElementVNode("span", { class: "foo" }, "foo"),
-  /*#__PURE__*/_createElementVNode("span", { class: "foo" }, "foo"),
-  /*#__PURE__*/_createElementVNode("span", { class: "foo" }, "foo"),
-  /*#__PURE__*/_createElementVNode("span", { class: "foo" }, "foo"),
-  /*#__PURE__*/_createElementVNode("img", { src: _imports_0_ })
+const _hoisted_1 = /*#__PURE__*/_createElementVNode(\\"div\\", null, [
+  /*#__PURE__*/_createElementVNode(\\"span\\", { class: \\"foo\\" }, \\"foo\\"),
+  /*#__PURE__*/_createElementVNode(\\"span\\", { class: \\"foo\\" }, \\"foo\\"),
+  /*#__PURE__*/_createElementVNode(\\"span\\", { class: \\"foo\\" }, \\"foo\\"),
+  /*#__PURE__*/_createElementVNode(\\"span\\", { class: \\"foo\\" }, \\"foo\\"),
+  /*#__PURE__*/_createElementVNode(\\"span\\", { class: \\"foo\\" }, \\"foo\\"),
+  /*#__PURE__*/_createElementVNode(\\"img\\", { src: _imports_0_ })
 ], -1 /* HOISTED */)
 const _hoisted_2 = [
   _hoisted_1
 ]
 
 return function render(_ctx, _cache) {
-  return (_openBlock(), _createElementBlock("div", null, _hoisted_2))
+  return (_openBlock(), _createElementBlock(\\"div\\", null, _hoisted_2))
 }"
 `;
 
-exports[`stringify static html should work with bindings that are non-static but stringifiable 1`] = `
+exports[`stringify static html should work with bindings that are non-static but stringifiable 1`] = `
 "const { createElementVNode: _createElementVNode, createStaticVNode: _createStaticVNode, openBlock: _openBlock, createElementBlock: _createElementBlock } = Vue
 
-const _hoisted_1 = /*#__PURE__*/_createStaticVNode("<div><span class=\\"foo\\">foo</span><span class=\\"foo\\">foo</span><span class=\\"foo\\">foo</span><span class=\\"foo\\">foo</span><span class=\\"foo\\">foo</span><img src=\\"" + _imports_0_ + "\\"></div>", 1)
+const _hoisted_1 = /*#__PURE__*/_createStaticVNode(\\"<div><span class=\\\\\\"foo\\\\\\">foo</span><span class=\\\\\\"foo\\\\\\">foo</span><span class=\\\\\\"foo\\\\\\">foo</span><span class=\\\\\\"foo\\\\\\">foo</span><span class=\\\\\\"foo\\\\\\">foo</span><img src=\\\\\\"\\" + _imports_0_ + \\"\\\\\\"></div>\\", 1)
 const _hoisted_2 = [
   _hoisted_1
 ]
 
 return function render(_ctx, _cache) {
-  return (_openBlock(), _createElementBlock("div", null, _hoisted_2))
+  return (_openBlock(), _createElementBlock(\\"div\\", null, _hoisted_2))
 }"
 `;
 
-exports[`stringify static html stringify v-html 1`] = `
+exports[`stringify static html stringify v-html 1`] = `
 "const { createElementVNode: _createElementVNode, createStaticVNode: _createStaticVNode } = Vue
 
-const _hoisted_1 = /*#__PURE__*/_createStaticVNode("<pre data-type=\\"js\\"><code><span>show-it </span></code></pre><div class><span class>1</span><span class>2</span></div>", 2)
+const _hoisted_1 = /*#__PURE__*/_createStaticVNode(\\"<pre data-type=\\\\\\"js\\\\\\"><code><span>show-it </span></code></pre><div class><span class>1</span><span class>2</span></div>\\", 2)
 
 return function render(_ctx, _cache) {
   return _hoisted_1
 }"
 `;
 
-exports[`stringify static html stringify v-text 1`] = `
+exports[`stringify static html stringify v-text 1`] = `
 "const { createElementVNode: _createElementVNode, createStaticVNode: _createStaticVNode } = Vue
 
-const _hoisted_1 = /*#__PURE__*/_createStaticVNode("<pre data-type=\\"js\\"><code>&lt;span&gt;show-it &lt;/span&gt;</code></pre><div class><span class>1</span><span class>2</span></div>", 2)
+const _hoisted_1 = /*#__PURE__*/_createStaticVNode(\\"<pre data-type=\\\\\\"js\\\\\\"><code>&lt;span&gt;show-it &lt;/span&gt;</code></pre><div class><span class>1</span><span class>2</span></div>\\", 2)
 
 return function render(_ctx, _cache) {
   return _hoisted_1
index 513f2572f8c76d38316d65d3ed8d50ae8734367c..d0c00ada0dbeda14c5cfcc2c424099c3249c65f6 100644 (file)
@@ -1,63 +1,63 @@
-// Jest Snapshot v1, https://goo.gl/fbAQLP
+// Vitest Snapshot v1
 
-exports[`compiler: transform v-model errors should allow usage on custom element 1`] = `
+exports[`compiler: transform v-model > errors > should allow usage on custom element 1`] = `
 "const _Vue = Vue
 
 return function render(_ctx, _cache) {
   with (_ctx) {
     const { vModelText: _vModelText, withDirectives: _withDirectives, openBlock: _openBlock, createElementBlock: _createElementBlock } = _Vue
 
-    return _withDirectives((_openBlock(), _createElementBlock("my-input", {
-      "onUpdate:modelValue": $event => ((model) = $event)
-    }, null, 8 /* PROPS */, ["onUpdate:modelValue"])), [
+    return _withDirectives((_openBlock(), _createElementBlock(\\"my-input\\", {
+      \\"onUpdate:modelValue\\": $event => ((model) = $event)
+    }, null, 8 /* PROPS */, [\\"onUpdate:modelValue\\"])), [
       [_vModelText, model]
     ])
   }
 }"
 `;
 
-exports[`compiler: transform v-model input w/ dynamic v-bind 1`] = `
+exports[`compiler: transform v-model input w/ dynamic v-bind 1`] = `
 "const _Vue = Vue
 
 return function render(_ctx, _cache) {
   with (_ctx) {
     const { vModelDynamic: _vModelDynamic, mergeProps: _mergeProps, withDirectives: _withDirectives, openBlock: _openBlock, createElementBlock: _createElementBlock } = _Vue
 
-    return _withDirectives((_openBlock(), _createElementBlock("input", _mergeProps(obj, {
-      "onUpdate:modelValue": $event => ((model) = $event)
-    }), null, 16 /* FULL_PROPS */, ["onUpdate:modelValue"])), [
+    return _withDirectives((_openBlock(), _createElementBlock(\\"input\\", _mergeProps(obj, {
+      \\"onUpdate:modelValue\\": $event => ((model) = $event)
+    }), null, 16 /* FULL_PROPS */, [\\"onUpdate:modelValue\\"])), [
       [_vModelDynamic, model]
     ])
   }
 }"
 `;
 
-exports[`compiler: transform v-model input w/ dynamic v-bind 2`] = `
+exports[`compiler: transform v-model input w/ dynamic v-bind 2`] = `
 "const _Vue = Vue
 
 return function render(_ctx, _cache) {
   with (_ctx) {
     const { vModelDynamic: _vModelDynamic, withDirectives: _withDirectives, openBlock: _openBlock, createElementBlock: _createElementBlock } = _Vue
 
-    return _withDirectives((_openBlock(), _createElementBlock("input", {
-      "onUpdate:modelValue": $event => ((model) = $event)
-    }, null, 8 /* PROPS */, ["onUpdate:modelValue"])), [
+    return _withDirectives((_openBlock(), _createElementBlock(\\"input\\", {
+      \\"onUpdate:modelValue\\": $event => ((model) = $event)
+    }, null, 8 /* PROPS */, [\\"onUpdate:modelValue\\"])), [
       [_vModelDynamic, model]
     ])
   }
 }"
 `;
 
-exports[`compiler: transform v-model modifiers .lazy 1`] = `
+exports[`compiler: transform v-model > modifiers > .lazy 1`] = `
 "const _Vue = Vue
 
 return function render(_ctx, _cache) {
   with (_ctx) {
     const { vModelText: _vModelText, withDirectives: _withDirectives, openBlock: _openBlock, createElementBlock: _createElementBlock } = _Vue
 
-    return _withDirectives((_openBlock(), _createElementBlock("input", {
-      "onUpdate:modelValue": $event => ((model) = $event)
-    }, null, 8 /* PROPS */, ["onUpdate:modelValue"])), [
+    return _withDirectives((_openBlock(), _createElementBlock(\\"input\\", {
+      \\"onUpdate:modelValue\\": $event => ((model) = $event)
+    }, null, 8 /* PROPS */, [\\"onUpdate:modelValue\\"])), [
       [
         _vModelText,
         model,
@@ -69,16 +69,16 @@ return function render(_ctx, _cache) {
 }"
 `;
 
-exports[`compiler: transform v-model modifiers .number 1`] = `
+exports[`compiler: transform v-model > modifiers > .number 1`] = `
 "const _Vue = Vue
 
 return function render(_ctx, _cache) {
   with (_ctx) {
     const { vModelText: _vModelText, withDirectives: _withDirectives, openBlock: _openBlock, createElementBlock: _createElementBlock } = _Vue
 
-    return _withDirectives((_openBlock(), _createElementBlock("input", {
-      "onUpdate:modelValue": $event => ((model) = $event)
-    }, null, 8 /* PROPS */, ["onUpdate:modelValue"])), [
+    return _withDirectives((_openBlock(), _createElementBlock(\\"input\\", {
+      \\"onUpdate:modelValue\\": $event => ((model) = $event)
+    }, null, 8 /* PROPS */, [\\"onUpdate:modelValue\\"])), [
       [
         _vModelText,
         model,
@@ -90,16 +90,16 @@ return function render(_ctx, _cache) {
 }"
 `;
 
-exports[`compiler: transform v-model modifiers .trim 1`] = `
+exports[`compiler: transform v-model > modifiers > .trim 1`] = `
 "const _Vue = Vue
 
 return function render(_ctx, _cache) {
   with (_ctx) {
     const { vModelText: _vModelText, withDirectives: _withDirectives, openBlock: _openBlock, createElementBlock: _createElementBlock } = _Vue
 
-    return _withDirectives((_openBlock(), _createElementBlock("input", {
-      "onUpdate:modelValue": $event => ((model) = $event)
-    }, null, 8 /* PROPS */, ["onUpdate:modelValue"])), [
+    return _withDirectives((_openBlock(), _createElementBlock(\\"input\\", {
+      \\"onUpdate:modelValue\\": $event => ((model) = $event)
+    }, null, 8 /* PROPS */, [\\"onUpdate:modelValue\\"])), [
       [
         _vModelText,
         model,
@@ -111,115 +111,115 @@ return function render(_ctx, _cache) {
 }"
 `;
 
-exports[`compiler: transform v-model simple expression 1`] = `
+exports[`compiler: transform v-model simple expression 1`] = `
 "const _Vue = Vue
 
 return function render(_ctx, _cache) {
   with (_ctx) {
     const { vModelText: _vModelText, withDirectives: _withDirectives, openBlock: _openBlock, createElementBlock: _createElementBlock } = _Vue
 
-    return _withDirectives((_openBlock(), _createElementBlock("input", {
-      "onUpdate:modelValue": $event => ((model) = $event)
-    }, null, 8 /* PROPS */, ["onUpdate:modelValue"])), [
+    return _withDirectives((_openBlock(), _createElementBlock(\\"input\\", {
+      \\"onUpdate:modelValue\\": $event => ((model) = $event)
+    }, null, 8 /* PROPS */, [\\"onUpdate:modelValue\\"])), [
       [_vModelText, model]
     ])
   }
 }"
 `;
 
-exports[`compiler: transform v-model simple expression for input (checkbox) 1`] = `
+exports[`compiler: transform v-model simple expression for input (checkbox) 1`] = `
 "const _Vue = Vue
 
 return function render(_ctx, _cache) {
   with (_ctx) {
     const { vModelCheckbox: _vModelCheckbox, withDirectives: _withDirectives, openBlock: _openBlock, createElementBlock: _createElementBlock } = _Vue
 
-    return _withDirectives((_openBlock(), _createElementBlock("input", {
-      type: "checkbox",
-      "onUpdate:modelValue": $event => ((model) = $event)
-    }, null, 8 /* PROPS */, ["onUpdate:modelValue"])), [
+    return _withDirectives((_openBlock(), _createElementBlock(\\"input\\", {
+      type: \\"checkbox\\",
+      \\"onUpdate:modelValue\\": $event => ((model) = $event)
+    }, null, 8 /* PROPS */, [\\"onUpdate:modelValue\\"])), [
       [_vModelCheckbox, model]
     ])
   }
 }"
 `;
 
-exports[`compiler: transform v-model simple expression for input (dynamic type) 1`] = `
+exports[`compiler: transform v-model simple expression for input (dynamic type) 1`] = `
 "const _Vue = Vue
 
 return function render(_ctx, _cache) {
   with (_ctx) {
     const { vModelDynamic: _vModelDynamic, withDirectives: _withDirectives, openBlock: _openBlock, createElementBlock: _createElementBlock } = _Vue
 
-    return _withDirectives((_openBlock(), _createElementBlock("input", {
-      "onUpdate:modelValue": $event => ((model) = $event)
-    }, null, 8 /* PROPS */, ["onUpdate:modelValue"])), [
+    return _withDirectives((_openBlock(), _createElementBlock(\\"input\\", {
+      \\"onUpdate:modelValue\\": $event => ((model) = $event)
+    }, null, 8 /* PROPS */, [\\"onUpdate:modelValue\\"])), [
       [_vModelDynamic, model]
     ])
   }
 }"
 `;
 
-exports[`compiler: transform v-model simple expression for input (radio) 1`] = `
+exports[`compiler: transform v-model simple expression for input (radio) 1`] = `
 "const _Vue = Vue
 
 return function render(_ctx, _cache) {
   with (_ctx) {
     const { vModelRadio: _vModelRadio, withDirectives: _withDirectives, openBlock: _openBlock, createElementBlock: _createElementBlock } = _Vue
 
-    return _withDirectives((_openBlock(), _createElementBlock("input", {
-      type: "radio",
-      "onUpdate:modelValue": $event => ((model) = $event)
-    }, null, 8 /* PROPS */, ["onUpdate:modelValue"])), [
+    return _withDirectives((_openBlock(), _createElementBlock(\\"input\\", {
+      type: \\"radio\\",
+      \\"onUpdate:modelValue\\": $event => ((model) = $event)
+    }, null, 8 /* PROPS */, [\\"onUpdate:modelValue\\"])), [
       [_vModelRadio, model]
     ])
   }
 }"
 `;
 
-exports[`compiler: transform v-model simple expression for input (text) 1`] = `
+exports[`compiler: transform v-model simple expression for input (text) 1`] = `
 "const _Vue = Vue
 
 return function render(_ctx, _cache) {
   with (_ctx) {
     const { vModelText: _vModelText, withDirectives: _withDirectives, openBlock: _openBlock, createElementBlock: _createElementBlock } = _Vue
 
-    return _withDirectives((_openBlock(), _createElementBlock("input", {
-      type: "text",
-      "onUpdate:modelValue": $event => ((model) = $event)
-    }, null, 8 /* PROPS */, ["onUpdate:modelValue"])), [
+    return _withDirectives((_openBlock(), _createElementBlock(\\"input\\", {
+      type: \\"text\\",
+      \\"onUpdate:modelValue\\": $event => ((model) = $event)
+    }, null, 8 /* PROPS */, [\\"onUpdate:modelValue\\"])), [
       [_vModelText, model]
     ])
   }
 }"
 `;
 
-exports[`compiler: transform v-model simple expression for select 1`] = `
+exports[`compiler: transform v-model simple expression for select 1`] = `
 "const _Vue = Vue
 
 return function render(_ctx, _cache) {
   with (_ctx) {
     const { vModelSelect: _vModelSelect, withDirectives: _withDirectives, openBlock: _openBlock, createElementBlock: _createElementBlock } = _Vue
 
-    return _withDirectives((_openBlock(), _createElementBlock("select", {
-      "onUpdate:modelValue": $event => ((model) = $event)
-    }, null, 8 /* PROPS */, ["onUpdate:modelValue"])), [
+    return _withDirectives((_openBlock(), _createElementBlock(\\"select\\", {
+      \\"onUpdate:modelValue\\": $event => ((model) = $event)
+    }, null, 8 /* PROPS */, [\\"onUpdate:modelValue\\"])), [
       [_vModelSelect, model]
     ])
   }
 }"
 `;
 
-exports[`compiler: transform v-model simple expression for textarea 1`] = `
+exports[`compiler: transform v-model simple expression for textarea 1`] = `
 "const _Vue = Vue
 
 return function render(_ctx, _cache) {
   with (_ctx) {
     const { vModelText: _vModelText, withDirectives: _withDirectives, openBlock: _openBlock, createElementBlock: _createElementBlock } = _Vue
 
-    return _withDirectives((_openBlock(), _createElementBlock("textarea", {
-      "onUpdate:modelValue": $event => ((model) = $event)
-    }, null, 8 /* PROPS */, ["onUpdate:modelValue"])), [
+    return _withDirectives((_openBlock(), _createElementBlock(\\"textarea\\", {
+      \\"onUpdate:modelValue\\": $event => ((model) = $event)
+    }, null, 8 /* PROPS */, [\\"onUpdate:modelValue\\"])), [
       [_vModelText, model]
     ])
   }
index fbd96bc428c41871e617d5bea3ab18d05a31d72f..e537f0b2bfa1c2b9e9b474883e75ac01a2f53789 100644 (file)
@@ -1,13 +1,13 @@
-// Jest Snapshot v1, https://goo.gl/fbAQLP
+// Vitest Snapshot v1
 
-exports[`compiler: v-show transform simple expression 1`] = `
+exports[`compiler: v-show transform simple expression 1`] = `
 "const _Vue = Vue
 
 return function render(_ctx, _cache) {
   with (_ctx) {
     const { vShow: _vShow, withDirectives: _withDirectives, openBlock: _openBlock, createElementBlock: _createElementBlock } = _Vue
 
-    return _withDirectives((_openBlock(), _createElementBlock("div", null, null, 512 /* NEED_PATCH */)), [
+    return _withDirectives((_openBlock(), _createElementBlock(\\"div\\", null, null, 512 /* NEED_PATCH */)), [
       [_vShow, a]
     ])
   }
index 159bd4ba3b010579974ffe18dd6d8147f8c35fdb..620d62da8223641919cb97d2afd1b1d34e2ec3fa 100644 (file)
@@ -21,7 +21,7 @@ export function createDOMCompilerError(
 }
 
 export const enum DOMErrorCodes {
-  X_V_HTML_NO_EXPRESSION = ErrorCodes.__EXTEND_POINT__,
+  X_V_HTML_NO_EXPRESSION = 51 /* ErrorCodes.__EXTEND_POINT__ */,
   X_V_HTML_WITH_CHILDREN,
   X_V_TEXT_NO_EXPRESSION,
   X_V_TEXT_WITH_CHILDREN,
@@ -35,6 +35,17 @@ export const enum DOMErrorCodes {
   __EXTEND_POINT__
 }
 
+if (__TEST__) {
+  // esbuild cannot infer const enum increments if first value is from another
+  // file, so we have to manually keep them in sync. this check ensures it
+  // errors out if there are collisions.
+  if (DOMErrorCodes.X_V_HTML_NO_EXPRESSION < ErrorCodes.__EXTEND_POINT__) {
+    throw new Error(
+      'DOMErrorCodes need to be updated to match extension point from core ErrorCodes.'
+    )
+  }
+}
+
 export const DOMErrorMessages: { [code: number]: string } = {
   [DOMErrorCodes.X_V_HTML_NO_EXPRESSION]: `v-html is missing expression.`,
   [DOMErrorCodes.X_V_HTML_WITH_CHILDREN]: `v-html will override element children.`,
index 443210e333f4dec66ef45e09f5ad720ff70e39a5..4d06a776b7af98e0500fb20f70fc3651971ee952 100644 (file)
@@ -2,7 +2,6 @@ import {
   TextModes,
   ParserOptions,
   ElementNode,
-  Namespaces,
   NodeTypes,
   isBuiltInType
 } from '@vue/compiler-core'
@@ -17,7 +16,7 @@ const isRawTextContainer = /*#__PURE__*/ makeMap(
 )
 
 export const enum DOMNamespaces {
-  HTML = Namespaces.HTML,
+  HTML = 0 /* Namespaces.HTML */,
   SVG,
   MATH_ML
 }