-
-
Notifications
You must be signed in to change notification settings - Fork 4.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
always use helpers if referenced, not just for CallExpressions, and w…
…arn on context clashes (#575)
- Loading branch information
1 parent
4f56b65
commit 75ea527
Showing
6 changed files
with
59 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
export default { | ||
html: '<p>1,4,9</p>' | ||
}; |
15 changes: 15 additions & 0 deletions
15
test/runtime/samples/helpers-not-call-expression/main.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
<p>{{numbers.map(square)}}</p> | ||
|
||
<script> | ||
export default { | ||
data () { | ||
return { | ||
numbers: [ 1, 2, 3 ] | ||
}; | ||
}, | ||
|
||
helpers: { | ||
square: num => num * num | ||
} | ||
}; | ||
</script> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
{{#each things as thing}} | ||
{{thing}} | ||
{{/each}} | ||
|
||
<script> | ||
export default { | ||
data () { | ||
return { things: [ 'a', 'b', 'c' ] }; | ||
}, | ||
|
||
helpers: { | ||
thing: function ( x ) { | ||
return x; | ||
} | ||
} | ||
}; | ||
</script> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
[{ | ||
"message": "Context clashes with a helper. Rename one or the other to eliminate any ambiguity", | ||
"loc": { | ||
"line": 1, | ||
"column": 18 | ||
}, | ||
"pos": 18 | ||
}] |