Skip to content

Commit 7910b7f

Browse files
committed
Fix syntax error when using state in trait values
Adjusted test to account for this case.
1 parent 197bc7e commit 7910b7f

File tree

2 files changed

+2
-13
lines changed

2 files changed

+2
-13
lines changed

src/generators/nodes/Element.ts

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -87,11 +87,6 @@ export default class Element extends Node {
8787
}
8888
} else if (attribute.type === 'Trait' && attribute.expression) {
8989
block.addDependencies(attribute.metadata.dependencies);
90-
if (attribute.expression.type === 'CallExpression') {
91-
attribute.expression.arguments.forEach((arg: Node) => {
92-
block.addDependencies(arg.metadata.dependencies);
93-
});
94-
}
9590
}
9691
}
9792
});
@@ -664,12 +659,6 @@ export default class Element extends Node {
664659
block.contextualise(expression);
665660
snippet = attribute.metadata.snippet;
666661
dependencies = attribute.metadata.dependencies;
667-
668-
if (expression.type === 'CallExpression') {
669-
expression.arguments.forEach((arg: Node) => {
670-
block.contextualise(arg, this.var);
671-
});
672-
}
673662
}
674663

675664
const name = block.getUniqueName(

test/runtime/samples/trait-function/main.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
<button with:tooltip="t('perform_action')">action</button>
1+
<button with:tooltip="t(actionTransKey)">action</button>
22

33
<script>
44
const translations = {
@@ -11,7 +11,7 @@
1111

1212
export default {
1313
data() {
14-
return { t };
14+
return { t, actionTransKey: 'perform_action' };
1515
},
1616

1717
traits: {

0 commit comments

Comments
 (0)