Skip to content

Commit

Permalink
Fix parsing errors in multiple v-for aliases in ecmaVersion: 5. (#96)
Browse files Browse the repository at this point in the history
* Fix parsing errors in multiple v-for aliases in ecmaVersion: 5.

* update
  • Loading branch information
ota-meshi committed Jan 21, 2021
1 parent 17507a4 commit 349b7dc
Show file tree
Hide file tree
Showing 24 changed files with 9,431 additions and 178 deletions.
324 changes: 271 additions & 53 deletions src/script/index.ts

Large diffs are not rendered by default.

236 changes: 118 additions & 118 deletions test/fixtures/ast/error-message-outside/ast.json

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion test/fixtures/ast/error-message-outside/source.vue
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<template>
{{a + }}
<div v-for="abc"></div>
<div v-for="i in abc."></div>
<div :foo="abc + (1"></div>
<div @click="abc('hello'"></div>
</template>
2 changes: 1 addition & 1 deletion test/fixtures/ast/error-message-outside/token-ranges.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
"<div",
"v-for",
"=",
"\"abc\"",
"\"i in abc.\"",
">",
"</div",
">",
Expand Down
10 changes: 5 additions & 5 deletions test/fixtures/ast/error-message-outside/tree.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[
{
"type": "VElement",
"text": "<template>\n {{a + }}\n <div v-for=\"abc\"></div>\n <div :foo=\"abc + (1\"></div>\n <div @click=\"abc('hello'\"></div>\n</template>",
"text": "<template>\n {{a + }}\n <div v-for=\"i in abc.\"></div>\n <div :foo=\"abc + (1\"></div>\n <div @click=\"abc('hello'\"></div>\n</template>",
"children": [
{
"type": "VStartTag",
Expand All @@ -25,15 +25,15 @@
},
{
"type": "VElement",
"text": "<div v-for=\"abc\"></div>",
"text": "<div v-for=\"i in abc.\"></div>",
"children": [
{
"type": "VStartTag",
"text": "<div v-for=\"abc\">",
"text": "<div v-for=\"i in abc.\">",
"children": [
{
"type": "VAttribute",
"text": "v-for=\"abc\"",
"text": "v-for=\"i in abc.\"",
"children": [
{
"type": "VDirectiveKey",
Expand All @@ -48,7 +48,7 @@
},
{
"type": "VExpressionContainer",
"text": "\"abc\"",
"text": "\"i in abc.\"",
"children": []
}
]
Expand Down
Loading

0 comments on commit 349b7dc

Please sign in to comment.