From ad75d899794bf2b42aaf2c3b016690b5716782ac Mon Sep 17 00:00:00 2001 From: daiwei Date: Thu, 14 Nov 2024 21:40:39 +0800 Subject: [PATCH 1/3] fix(compiler-dom): properly stringify template string bindings --- .../stringifyStatic.spec.ts.snap | 10 +++++++++ .../transforms/stringifyStatic.spec.ts | 21 +++++++++++++++++++ packages/shared/src/normalizeProp.ts | 6 +++--- 3 files changed, 34 insertions(+), 3 deletions(-) diff --git a/packages/compiler-dom/__tests__/transforms/__snapshots__/stringifyStatic.spec.ts.snap b/packages/compiler-dom/__tests__/transforms/__snapshots__/stringifyStatic.spec.ts.snap index a863eb32e61..bb8a6e52298 100644 --- a/packages/compiler-dom/__tests__/transforms/__snapshots__/stringifyStatic.spec.ts.snap +++ b/packages/compiler-dom/__tests__/transforms/__snapshots__/stringifyStatic.spec.ts.snap @@ -32,6 +32,16 @@ return function render(_ctx, _cache) { }" `; +exports[`stringify static html > serializing string literal constant bindings 1`] = ` +"const { toDisplayString: _toDisplayString, normalizeClass: _normalizeClass, createElementVNode: _createElementVNode, createStaticVNode: _createStaticVNode, openBlock: _openBlock, createElementBlock: _createElementBlock } = Vue + +return function render(_ctx, _cache) { + return (_openBlock(), _createElementBlock("div", null, _cache[0] || (_cache[0] = [ + _createStaticVNode("
1 + false1 + false1 + false1 + false1 + false
", 1) + ]))) +}" +`; + exports[`stringify static html > should bail for