]> git.ipfire.org Git - thirdparty/vuejs/core.git/commitdiff
fix(compiler-core): pick last char when dynamic directive doesn't close (#4507)
authorHerrington Darkholme <2883231+HerringtonDarkholme@users.noreply.github.com>
Tue, 7 Sep 2021 15:36:37 +0000 (23:36 +0800)
committerGitHub <noreply@github.com>
Tue, 7 Sep 2021 15:36:37 +0000 (11:36 -0400)
packages/compiler-core/__tests__/__snapshots__/parse.spec.ts.snap
packages/compiler-core/src/parse.ts

index d14631367cb3977cab7809c26435196c6c7e4b98..d7ac9888a598a4f7547397fd1898d456b55dc1d3 100644 (file)
@@ -6260,7 +6260,7 @@ Object {
         Object {
           "arg": Object {
             "constType": 0,
-            "content": "se",
+            "content": "sef",
             "isStatic": false,
             "loc": Object {
               "end": Object {
index 907e54d742e947a63ff1f0af489105190e3a44f2..fd31f17aee7099763ae0b761b0b83ebe53151918 100644 (file)
@@ -814,9 +814,10 @@ function parseAttribute(
             context,
             ErrorCodes.X_MISSING_DYNAMIC_DIRECTIVE_ARGUMENT_END
           )
+          content = content.substr(1)
+        } else {
+          content = content.substr(1, content.length - 2)
         }
-
-        content = content.substr(1, content.length - 2)
       } else if (isSlot) {
         // #1241 special case for v-slot: vuetify relies extensively on slot
         // names containing dots. v-slot doesn't have any modifiers and Vue 2.x