simplify test slightly, add test for reserved words

pull/1106/head
Rich Harris 8 years ago
parent 146327e87f
commit b19303679d

@ -0,0 +1,9 @@
[{
"message":
"Computed property name 'new' is invalid — cannot be a JavaScript reserved word",
"loc": {
"line": 9,
"column": 3
},
"pos": 87
}]

@ -0,0 +1,12 @@
<script>
export default {
data() {
return {
a: 1
};
},
computed: {
new: a => a * 2
}
};
</script>

@ -1,8 +1,8 @@
[{ [{
"message": "Computed property name 'hours-hyphen' is invalid — must be a valid identifier such as hours_hyphen", "message": "Computed property name 'with-hyphen' is invalid — must be a valid identifier such as with_hyphen",
"loc": { "loc": {
"line": 14, "line": 9,
"column": 3 "column": 3
}, },
"pos": 150 "pos": 87
}] }]

@ -1,17 +1,12 @@
<p>
The hour is
<strong>{{hours}}</strong>
</p>
<script> <script>
export default { export default {
data() { data() {
return { return {
time: new Date() a: 1
}; };
}, },
computed: { computed: {
"hours-hyphen": time => time.getHours() "with-hyphen": a => a * 2
} }
}; };
</script> </script>

Loading…
Cancel
Save