]> git.ipfire.org Git - thirdparty/vuejs/core.git/commitdiff
chore: Merge branch 'main' into minor
authorEvan You <yyx990803@gmail.com>
Tue, 5 Dec 2023 02:54:20 +0000 (10:54 +0800)
committerEvan You <yyx990803@gmail.com>
Tue, 5 Dec 2023 02:54:20 +0000 (10:54 +0800)
1  2 
package.json
packages/compiler-core/__tests__/__snapshots__/parse.spec.ts.snap
packages/compiler-core/__tests__/codegen.spec.ts
packages/compiler-core/__tests__/transforms/__snapshots__/transformExpressions.spec.ts.snap
packages/compiler-sfc/__tests__/__snapshots__/compileScript.spec.ts.snap
packages/compiler-sfc/__tests__/__snapshots__/compileTemplate.spec.ts.snap
packages/compiler-sfc/__tests__/compileScript/__snapshots__/defineEmits.spec.ts.snap
packages/compiler-sfc/__tests__/compileScript/__snapshots__/definePropsDestructure.spec.ts.snap
pnpm-lock.yaml

diff --cc package.json
index 1f4d5e994862b39afd5a3bad06975a87be499568,0dfa0df4825ad57bc049b66e5ff5216a6903ab59..9564d3e51ffa79329a0da8878e921de2d1664daa
      "dev-sfc-run": "run-p \"dev compiler-sfc -f esm-browser\" \"dev vue -if esm-bundler-runtime\" \"dev vue -ipf esm-browser-runtime\" \"dev server-renderer -if esm-bundler\" dev-sfc-serve",
      "serve": "serve",
      "open": "open http://localhost:3000/packages/template-explorer/local.html",
-     "build-sfc-playground": "run-s build-all-cjs build-runtime-esm build-ssr-esm build-sfc-playground-self",
+     "build-sfc-playground": "run-s build-all-cjs build-runtime-esm build-browser-esm build-ssr-esm build-sfc-playground-self",
 -    "build-all-cjs": "node scripts/build.js vue runtime compiler reactivity reactivity-transform shared -af cjs",
 +    "build-all-cjs": "node scripts/build.js vue runtime compiler reactivity shared -af cjs",
      "build-runtime-esm": "node scripts/build.js runtime reactivity shared -af esm-bundler && node scripts/build.js vue -f esm-bundler-runtime && node scripts/build.js vue -f esm-browser-runtime",
+     "build-browser-esm": "node scripts/build.js runtime reactivity shared -af esm-bundler && node scripts/build.js vue -f esm-bundler && node scripts/build.js vue -f esm-browser",
      "build-ssr-esm": "node scripts/build.js compiler-sfc server-renderer -f esm-browser",
      "build-sfc-playground-self": "cd packages/sfc-playground && npm run build",
      "preinstall": "npx only-allow pnpm",
index 8886ce33717d0df489ebdbbdd53b7e8246ebde81,5217a15023d8a8d7010e69088b22a84ef523ff36..63dea7e19ddb0f8cc9031d463e8a0408adce76ce
@@@ -89,16 -75,34 +89,16 @@@ exports[`compiler: parse > Edge Cases 
    "cached": 0,
    "children": [
      {
 -      "children": [
 -        {
 -          "content": "",
 -          "loc": {
 -            "end": {
 -              "column": 17,
 -              "line": 1,
 -              "offset": 16,
 -            },
 -            "source": "<!--->",
 -            "start": {
 -              "column": 11,
 -              "line": 1,
 -              "offset": 10,
 -            },
 -          },
 -          "type": 3,
 -        },
 -      ],
 +      "children": [],
        "codegenNode": undefined,
 -      "isSelfClosing": false,
 +      "isSelfClosing": true,
        "loc": {
          "end": {
 -          "column": 28,
 +          "column": 37,
            "line": 1,
 -          "offset": 27,
 +          "offset": 36,
          },
-         "source": "<div :class=\\"{ some: condition }\\" />",
 -        "source": "<template><!---></template>",
++        "source": "<div :class="{ some: condition }" />",
          "start": {
            "column": 1,
            "line": 1,
          },
        },
        "ns": 0,
 -      "props": [],
 -      "tag": "template",
 -      "tagType": 0,
 -      "type": 1,
 -    },
 -  ],
 -  "codegenNode": undefined,
 -  "components": [],
 -  "directives": [],
 -  "helpers": Set {},
 -  "hoists": [],
 -  "imports": [],
 -  "loc": {
 -    "end": {
 -      "column": 28,
 -      "line": 1,
 -      "offset": 27,
 -    },
 -    "source": "<template><!---></template>",
 -    "start": {
 -      "column": 1,
 -      "line": 1,
 -      "offset": 0,
 -    },
 -  },
 -  "temps": 0,
 -  "type": 0,
 -}
 -`;
 -
 -exports[`compiler: parse > Errors > ABRUPT_CLOSING_OF_EMPTY_COMMENT > <template><!----></template> 1`] = `
 -{
 -  "cached": 0,
 -  "children": [
 -    {
 -      "children": [
 +      "props": [
          {
 -          "content": "",
 +          "arg": {
 +            "constType": 3,
 +            "content": "class",
 +            "isStatic": true,
 +            "loc": {
 +              "end": {
 +                "column": 12,
 +                "line": 1,
 +                "offset": 11,
 +              },
 +              "source": "class",
 +              "start": {
 +                "column": 7,
 +                "line": 1,
 +                "offset": 6,
 +              },
 +            },
 +            "type": 4,
 +          },
 +          "exp": {
 +            "constType": 0,
 +            "content": "{ some: condition }",
 +            "isStatic": false,
 +            "loc": {
 +              "end": {
 +                "column": 33,
 +                "line": 1,
 +                "offset": 32,
 +              },
 +              "source": "{ some: condition }",
 +              "start": {
 +                "column": 14,
 +                "line": 1,
 +                "offset": 13,
 +              },
 +            },
 +            "type": 4,
 +          },
            "loc": {
              "end": {
 -              "column": 18,
 +              "column": 34,
                "line": 1,
 -              "offset": 17,
 +              "offset": 33,
              },
-             "source": ":class=\\"{ some: condition }\\"",
 -            "source": "<!---->",
++            "source": ":class="{ some: condition }"",
              "start": {
 -              "column": 11,
 +              "column": 6,
                "line": 1,
 -              "offset": 10,
 +              "offset": 5,
              },
            },
 -          "type": 3,
 +          "modifiers": [],
 +          "name": "bind",
 +          "rawName": ":class",
 +          "type": 7,
          },
        ],
 +      "tag": "div",
 +      "tagType": 0,
 +      "type": 1,
 +    },
 +    {
 +      "children": [],
        "codegenNode": undefined,
 -      "isSelfClosing": false,
 +      "isSelfClosing": true,
        "loc": {
          "end": {
 -          "column": 29,
 -          "line": 1,
 -          "offset": 28,
 +          "column": 37,
 +          "line": 2,
 +          "offset": 73,
          },
-         "source": "<p v-bind:style=\\"{ color: 'red' }\\"/>",
 -        "source": "<template><!----></template>",
++        "source": "<p v-bind:style="{ color: 'red' }"/>",
          "start": {
            "column": 1,
 -          "line": 1,
 -          "offset": 0,
 +          "line": 2,
 +          "offset": 37,
          },
        },
        "ns": 0,
 -      "props": [],
 -      "tag": "template",
 +      "props": [
 +        {
 +          "arg": {
 +            "constType": 3,
 +            "content": "style",
 +            "isStatic": true,
 +            "loc": {
 +              "end": {
 +                "column": 16,
 +                "line": 2,
 +                "offset": 52,
 +              },
 +              "source": "style",
 +              "start": {
 +                "column": 11,
 +                "line": 2,
 +                "offset": 47,
 +              },
 +            },
 +            "type": 4,
 +          },
 +          "exp": {
 +            "constType": 0,
 +            "content": "{ color: 'red' }",
 +            "isStatic": false,
 +            "loc": {
 +              "end": {
 +                "column": 34,
 +                "line": 2,
 +                "offset": 70,
 +              },
 +              "source": "{ color: 'red' }",
 +              "start": {
 +                "column": 18,
 +                "line": 2,
 +                "offset": 54,
 +              },
 +            },
 +            "type": 4,
 +          },
 +          "loc": {
 +            "end": {
 +              "column": 35,
 +              "line": 2,
 +              "offset": 71,
 +            },
-             "source": "v-bind:style=\\"{ color: 'red' }\\"",
++            "source": "v-bind:style="{ color: 'red' }"",
 +            "start": {
 +              "column": 4,
 +              "line": 2,
 +              "offset": 40,
 +            },
 +          },
 +          "modifiers": [],
 +          "name": "bind",
 +          "rawName": "v-bind:style",
 +          "type": 7,
 +        },
 +      ],
 +      "tag": "p",
        "tagType": 0,
        "type": 1,
      },
    "imports": [],
    "loc": {
      "end": {
 -      "column": 29,
 -      "line": 1,
 -      "offset": 28,
 +      "column": 37,
 +      "line": 2,
 +      "offset": 73,
      },
-     "source": "<div :class=\\"{ some: condition }\\" />
- <p v-bind:style=\\"{ color: 'red' }\\"/>",
 -    "source": "<template><!----></template>",
++    "source": "<div :class="{ some: condition }" />
++<p v-bind:style="{ color: 'red' }"/>",
      "start": {
        "column": 1,
        "line": 1,
        "offset": 0,
      },
    },
-   "source": "<div :class=\\"{ some: condition }\\" />
- <p v-bind:style=\\"{ color: 'red' }\\"/>",
++  "source": "<div :class="{ some: condition }" />
++<p v-bind:style="{ color: 'red' }"/>",
    "temps": 0,
    "type": 0,
  }
@@@ -285,224 -217,25 +285,224 @@@ exports[`compiler: parse > Edge Cases 
      {
        "children": [
          {
 -          "content": "[CDATA[cdata]]",
 +          "children": [],
 +          "codegenNode": undefined,
 +          "isSelfClosing": true,
            "loc": {
              "end": {
 -              "column": 28,
 -              "line": 1,
 -              "offset": 27,
 +              "column": 39,
 +              "line": 2,
 +              "offset": 73,
              },
-             "source": "<p v-bind:style=\\"{ color: 'red' }\\"/>",
 -            "source": "<![CDATA[cdata]]>",
++            "source": "<p v-bind:style="{ color: 'red' }"/>",
              "start": {
 -              "column": 11,
 -              "line": 1,
 -              "offset": 10,
 +              "column": 3,
 +              "line": 2,
 +              "offset": 37,
 +            },
 +          },
 +          "ns": 0,
 +          "props": [
 +            {
 +              "arg": {
 +                "constType": 3,
 +                "content": "style",
 +                "isStatic": true,
 +                "loc": {
 +                  "end": {
 +                    "column": 18,
 +                    "line": 2,
 +                    "offset": 52,
 +                  },
 +                  "source": "style",
 +                  "start": {
 +                    "column": 13,
 +                    "line": 2,
 +                    "offset": 47,
 +                  },
 +                },
 +                "type": 4,
 +              },
 +              "exp": {
 +                "constType": 0,
 +                "content": "{ color: 'red' }",
 +                "isStatic": false,
 +                "loc": {
 +                  "end": {
 +                    "column": 36,
 +                    "line": 2,
 +                    "offset": 70,
 +                  },
 +                  "source": "{ color: 'red' }",
 +                  "start": {
 +                    "column": 20,
 +                    "line": 2,
 +                    "offset": 54,
 +                  },
 +                },
 +                "type": 4,
 +              },
 +              "loc": {
 +                "end": {
 +                  "column": 37,
 +                  "line": 2,
 +                  "offset": 71,
 +                },
-                 "source": "v-bind:style=\\"{ color: 'red' }\\"",
++                "source": "v-bind:style="{ color: 'red' }"",
 +                "start": {
 +                  "column": 6,
 +                  "line": 2,
 +                  "offset": 40,
 +                },
 +              },
 +              "modifiers": [],
 +              "name": "bind",
 +              "rawName": "v-bind:style",
 +              "type": 7,
 +            },
 +          ],
 +          "tag": "p",
 +          "tagType": 0,
 +          "type": 1,
 +        },
 +        {
 +          "content": " a comment with <html> inside it ",
 +          "loc": {
 +            "end": {
 +              "column": 43,
 +              "line": 3,
 +              "offset": 116,
 +            },
 +            "source": "<!-- a comment with <html> inside it -->",
 +            "start": {
 +              "column": 3,
 +              "line": 3,
 +              "offset": 76,
              },
            },
            "type": 3,
          },
        ],
        "codegenNode": undefined,
 -      "isSelfClosing": false,
 +      "loc": {
 +        "end": {
 +          "column": 7,
 +          "line": 4,
 +          "offset": 123,
 +        },
-         "source": "<div :class=\\"{ some: condition }\\">
-   <p v-bind:style=\\"{ color: 'red' }\\"/>
++        "source": "<div :class="{ some: condition }">
++  <p v-bind:style="{ color: 'red' }"/>
 +  <!-- a comment with <html> inside it -->
 +</div>",
 +        "start": {
 +          "column": 1,
 +          "line": 1,
 +          "offset": 0,
 +        },
 +      },
 +      "ns": 0,
 +      "props": [
 +        {
 +          "arg": {
 +            "constType": 3,
 +            "content": "class",
 +            "isStatic": true,
 +            "loc": {
 +              "end": {
 +                "column": 12,
 +                "line": 1,
 +                "offset": 11,
 +              },
 +              "source": "class",
 +              "start": {
 +                "column": 7,
 +                "line": 1,
 +                "offset": 6,
 +              },
 +            },
 +            "type": 4,
 +          },
 +          "exp": {
 +            "constType": 0,
 +            "content": "{ some: condition }",
 +            "isStatic": false,
 +            "loc": {
 +              "end": {
 +                "column": 33,
 +                "line": 1,
 +                "offset": 32,
 +              },
 +              "source": "{ some: condition }",
 +              "start": {
 +                "column": 14,
 +                "line": 1,
 +                "offset": 13,
 +              },
 +            },
 +            "type": 4,
 +          },
 +          "loc": {
 +            "end": {
 +              "column": 34,
 +              "line": 1,
 +              "offset": 33,
 +            },
-             "source": ":class=\\"{ some: condition }\\"",
++            "source": ":class="{ some: condition }"",
 +            "start": {
 +              "column": 6,
 +              "line": 1,
 +              "offset": 5,
 +            },
 +          },
 +          "modifiers": [],
 +          "name": "bind",
 +          "rawName": ":class",
 +          "type": 7,
 +        },
 +      ],
 +      "tag": "div",
 +      "tagType": 0,
 +      "type": 1,
 +    },
 +  ],
 +  "codegenNode": undefined,
 +  "components": [],
 +  "directives": [],
 +  "helpers": Set {},
 +  "hoists": [],
 +  "imports": [],
 +  "loc": {
 +    "end": {
 +      "column": 7,
 +      "line": 4,
 +      "offset": 123,
 +    },
-     "source": "<div :class=\\"{ some: condition }\\">
-   <p v-bind:style=\\"{ color: 'red' }\\"/>
++    "source": "<div :class="{ some: condition }">
++  <p v-bind:style="{ color: 'red' }"/>
 +  <!-- a comment with <html> inside it -->
 +</div>",
 +    "start": {
 +      "column": 1,
 +      "line": 1,
 +      "offset": 0,
 +    },
 +  },
-   "source": "<div :class=\\"{ some: condition }\\">
-   <p v-bind:style=\\"{ color: 'red' }\\"/>
++  "source": "<div :class="{ some: condition }">
++  <p v-bind:style="{ color: 'red' }"/>
 +  <!-- a comment with <html> inside it -->
 +</div>",
 +  "temps": 0,
 +  "type": 0,
 +}
 +`;
 +
 +exports[`compiler: parse > Errors > CDATA_IN_HTML_CONTENT > <template><![CDATA[cdata]]></template> 1`] = `
 +{
 +  "cached": 0,
 +  "children": [
 +    {
 +      "children": [],
 +      "codegenNode": undefined,
        "loc": {
          "end": {
            "column": 39,
@@@ -805,7 -514,6 +805,7 @@@ exports[`compiler: parse > Errors > DUP
        "offset": 0,
      },
    },
-   "source": "<template><div id=\\"\\" id=\\"\\"></div></template>",
++  "source": "<template><div id="" id=""></div></template>",
    "temps": 0,
    "type": 0,
  }
@@@ -1558,15 -1528,40 +1558,15 @@@ exports[`compiler: parse > Errors > EOF
    "cached": 0,
    "children": [
      {
 -      "children": [
 -        {
 -          "children": [],
 -          "codegenNode": undefined,
 -          "isSelfClosing": false,
 -          "loc": {
 -            "end": {
 -              "column": 16,
 -              "line": 1,
 -              "offset": 15,
 -            },
 -            "source": "<div ",
 -            "start": {
 -              "column": 11,
 -              "line": 1,
 -              "offset": 10,
 -            },
 -          },
 -          "ns": 0,
 -          "props": [],
 -          "tag": "div",
 -          "tagType": 0,
 -          "type": 1,
 -        },
 -      ],
 +      "children": [],
        "codegenNode": undefined,
 -      "isSelfClosing": false,
        "loc": {
          "end": {
 -          "column": 16,
 +          "column": 24,
            "line": 1,
 -          "offset": 15,
 +          "offset": 23,
          },
-         "source": "<template><div id=\\"abc",
 -        "source": "<template><div ",
++        "source": "<template><div id="abc",
          "start": {
            "column": 1,
            "line": 1,
    "imports": [],
    "loc": {
      "end": {
 -      "column": 16,
 +      "column": 23,
        "line": 1,
 -      "offset": 15,
 +      "offset": 22,
      },
-     "source": "<template><div id=\\"abc",
 -    "source": "<template><div ",
++    "source": "<template><div id="abc",
      "start": {
        "column": 1,
        "line": 1,
        "offset": 0,
      },
    },
-   "source": "<template><div id=\\"abc",
++  "source": "<template><div id="abc",
    "temps": 0,
    "type": 0,
  }
@@@ -1610,15 -1604,40 +1610,15 @@@ exports[`compiler: parse > Errors > EOF
    "cached": 0,
    "children": [
      {
 -      "children": [
 -        {
 -          "children": [],
 -          "codegenNode": undefined,
 -          "isSelfClosing": false,
 -          "loc": {
 -            "end": {
 -              "column": 15,
 -              "line": 1,
 -              "offset": 14,
 -            },
 -            "source": "<div",
 -            "start": {
 -              "column": 11,
 -              "line": 1,
 -              "offset": 10,
 -            },
 -          },
 -          "ns": 0,
 -          "props": [],
 -          "tag": "div",
 -          "tagType": 0,
 -          "type": 1,
 -        },
 -      ],
 +      "children": [],
        "codegenNode": undefined,
 -      "isSelfClosing": false,
        "loc": {
          "end": {
 -          "column": 15,
 +          "column": 25,
            "line": 1,
 -          "offset": 14,
 +          "offset": 24,
          },
-         "source": "<template><div id=\\"abc\\"",
 -        "source": "<template><div",
++        "source": "<template><div id="abc"",
          "start": {
            "column": 1,
            "line": 1,
    "imports": [],
    "loc": {
      "end": {
 -      "column": 15,
 +      "column": 24,
        "line": 1,
 -      "offset": 14,
 +      "offset": 23,
      },
-     "source": "<template><div id=\\"abc\\"",
 -    "source": "<template><div",
++    "source": "<template><div id="abc"",
      "start": {
        "column": 1,
        "line": 1,
        "offset": 0,
      },
    },
-   "source": "<template><div id=\\"abc\\"",
++  "source": "<template><div id="abc"",
    "temps": 0,
    "type": 0,
  }
@@@ -1682,13 -1725,14 +1682,13 @@@ exports[`compiler: parse > Errors > EOF
          },
        ],
        "codegenNode": undefined,
 -      "isSelfClosing": false,
        "loc": {
          "end": {
 -          "column": 19,
 +          "column": 26,
            "line": 1,
 -          "offset": 18,
 +          "offset": 25,
          },
-         "source": "<template><div id=\\"abc\\"/",
 -        "source": "<template><div id ",
++        "source": "<template><div id="abc"/",
          "start": {
            "column": 1,
            "line": 1,
    "imports": [],
    "loc": {
      "end": {
 -      "column": 19,
 +      "column": 25,
        "line": 1,
 -      "offset": 18,
 +      "offset": 24,
      },
-     "source": "<template><div id=\\"abc\\"/",
 -    "source": "<template><div id ",
++    "source": "<template><div id="abc"/",
      "start": {
        "column": 1,
        "line": 1,
        "offset": 0,
      },
    },
-   "source": "<template><div id=\\"abc\\"/",
++  "source": "<template><div id="abc"/",
    "temps": 0,
    "type": 0,
  }
@@@ -2453,13 -2635,14 +2453,13 @@@ exports[`compiler: parse > Errors > UNE
          {
            "children": [],
            "codegenNode": undefined,
 -          "isSelfClosing": false,
            "loc": {
              "end": {
 -              "column": 24,
 +              "column": 30,
                "line": 1,
 -              "offset": 23,
 +              "offset": 29,
              },
-             "source": "<div a\\"bc=''></div>",
 -            "source": "<div id=abc /",
++            "source": "<div a"bc=''></div>",
              "start": {
                "column": 11,
                "line": 1,
              {
                "loc": {
                  "end": {
 -                  "column": 22,
 +                  "column": 23,
                    "line": 1,
 -                  "offset": 21,
 +                  "offset": 22,
                  },
-                 "source": "a\\"bc=''",
 -                "source": "id=abc",
++                "source": "a"bc=''",
 +                "start": {
 +                  "column": 16,
 +                  "line": 1,
 +                  "offset": 15,
 +                },
 +              },
-               "name": "a\\"bc",
++              "name": "a"bc",
 +              "nameLoc": {
 +                "end": {
 +                  "column": 20,
 +                  "line": 1,
 +                  "offset": 19,
 +                },
-                 "source": "a\\"bc",
++                "source": "a"bc",
                  "start": {
                    "column": 16,
                    "line": 1,
          },
        ],
        "codegenNode": undefined,
 -      "isSelfClosing": false,
        "loc": {
          "end": {
 -          "column": 24,
 +          "column": 41,
            "line": 1,
 -          "offset": 23,
 +          "offset": 40,
          },
-         "source": "<template><div a\\"bc=''></div></template>",
 -        "source": "<template><div id=abc /",
++        "source": "<template><div a"bc=''></div></template>",
          "start": {
            "column": 1,
            "line": 1,
    "imports": [],
    "loc": {
      "end": {
 -      "column": 24,
 +      "column": 41,
        "line": 1,
 -      "offset": 23,
 +      "offset": 40,
      },
-     "source": "<template><div a\\"bc=''></div></template>",
 -    "source": "<template><div id=abc /",
++    "source": "<template><div a"bc=''></div></template>",
      "start": {
        "column": 1,
        "line": 1,
        "offset": 0,
      },
    },
-   "source": "<template><div a\\"bc=''></div></template>",
++  "source": "<template><div a"bc=''></div></template>",
    "temps": 0,
    "type": 0,
  }
@@@ -2820,84 -2971,32 +2820,84 @@@ exports[`compiler: parse > Errors > UNE
      {
        "children": [
          {
 -          "content": "",
 +          "children": [],
 +          "codegenNode": undefined,
            "loc": {
              "end": {
 -              "column": 14,
 +              "column": 31,
                "line": 1,
 -              "offset": 13,
 +              "offset": 30,
              },
-             "source": "<div foo=bar\\"></div>",
 -            "source": "<!>",
++            "source": "<div foo=bar"></div>",
              "start": {
                "column": 11,
                "line": 1,
                "offset": 10,
              },
            },
 -          "type": 3,
 +          "ns": 0,
 +          "props": [
 +            {
 +              "loc": {
 +                "end": {
 +                  "column": 24,
 +                  "line": 1,
 +                  "offset": 23,
 +                },
-                 "source": "foo=bar\\"",
++                "source": "foo=bar"",
 +                "start": {
 +                  "column": 16,
 +                  "line": 1,
 +                  "offset": 15,
 +                },
 +              },
 +              "name": "foo",
 +              "nameLoc": {
 +                "end": {
 +                  "column": 19,
 +                  "line": 1,
 +                  "offset": 18,
 +                },
 +                "source": "foo",
 +                "start": {
 +                  "column": 16,
 +                  "line": 1,
 +                  "offset": 15,
 +                },
 +              },
 +              "type": 6,
 +              "value": {
-                 "content": "bar\\"",
++                "content": "bar"",
 +                "loc": {
 +                  "end": {
 +                    "column": 24,
 +                    "line": 1,
 +                    "offset": 23,
 +                  },
-                   "source": "bar\\"",
++                  "source": "bar"",
 +                  "start": {
 +                    "column": 20,
 +                    "line": 1,
 +                    "offset": 19,
 +                  },
 +                },
 +                "type": 2,
 +              },
 +            },
 +          ],
 +          "tag": "div",
 +          "tagType": 0,
 +          "type": 1,
          },
        ],
        "codegenNode": undefined,
 -      "isSelfClosing": false,
        "loc": {
          "end": {
 -          "column": 25,
 +          "column": 42,
            "line": 1,
 -          "offset": 24,
 +          "offset": 41,
          },
-         "source": "<template><div foo=bar\\"></div></template>",
 -        "source": "<template><!></template>",
++        "source": "<template><div foo=bar"></div></template>",
          "start": {
            "column": 1,
            "line": 1,
    "imports": [],
    "loc": {
      "end": {
 -      "column": 25,
 +      "column": 42,
        "line": 1,
 -      "offset": 24,
 +      "offset": 41,
      },
-     "source": "<template><div foo=bar\\"></div></template>",
 -    "source": "<template><!></template>",
++    "source": "<template><div foo=bar"></div></template>",
      "start": {
        "column": 1,
        "line": 1,
        "offset": 0,
      },
    },
-   "source": "<template><div foo=bar\\"></div></template>",
++  "source": "<template><div foo=bar"></div></template>",
    "temps": 0,
    "type": 0,
  }
index 7df7d8babe959776c0cba94d1bf225523982f091,0bc427b979f22152d2f7c34a7090e2bd65b4867b..9f4406864dbb31f3729848b93aa3fab938d5bb37
@@@ -22,9 -22,9 +22,9 @@@ return function render(_ctx, _cache, $p
      onClick: () => {
            for (let i = 0; i < _ctx.list.length; i++) {
              _ctx.log(i)
 -          }         
 +          }
          }
-   }, null, 8 /* PROPS */, [\\"onClick\\"]))
+   }, null, 8 /* PROPS */, ["onClick"]))
  }"
  `;
  
@@@ -36,9 -36,9 +36,9 @@@ return function render(_ctx, _cache, $p
      onClick: () => {
            for (const x in _ctx.list) {
              _ctx.log(x)
 -          }         
 +          }
          }
-   }, null, 8 /* PROPS */, [\\"onClick\\"]))
+   }, null, 8 /* PROPS */, ["onClick"]))
  }"
  `;
  
@@@ -50,8 -50,8 +50,8 @@@ return function render(_ctx, _cache, $p
      onClick: () => {
            for (const x of _ctx.list) {
              _ctx.log(x)
 -          }         
 +          }
          }
-   }, null, 8 /* PROPS */, [\\"onClick\\"]))
+   }, null, 8 /* PROPS */, ["onClick"]))
  }"
  `;
index 220c6860771078612561f1ade10db4cb93033a25,f44fcadb9c0597c66f151c12b4bdda56b1e9dade..b2c6904fbacce792f3d7c15037f120edf35f62cd
@@@ -47,9 -45,8 +47,9 @@@ return { a 
  `;
  
  exports[`SFC compile <script setup> > <script> and <script setup> co-usage > export call expression as default 1`] = `
 -"function fn() {
 +"
 +      function fn() {
-         return \\"hello, world\\";
+         return "hello, world";
        }
        const __default__ = fn();
        
@@@ -879,13 -825,9 +879,13 @@@ export default 
    setup(__props, { expose: __expose }) {
    __expose();
  
 -      let foo = _ref(1)
 +_useCssVars(_ctx => ({
-   \\"xxxxxxxx-msg\\": (msg.value)
++  "xxxxxxxx-msg": (msg.value)
 +}))
 +
 +      const msg = ref()
        
 -return { foo, ref }
 +return { msg, useCssVars, ref }
  }
  
  }"
@@@ -958,9 -898,7 +958,9 @@@ return { ref 
  `;
  
  exports[`SFC compile <script setup> > imports > should support module string names syntax 1`] = `
 -"import { "😏" as foo } from './foo'
 +"
 +      
-         import { \\"😏\\" as foo } from './foo'
++        import { "😏" as foo } from './foo'
        
  export default {
    setup(__props, { expose: __expose }) {
diff --cc pnpm-lock.yaml
Simple merge