mirror of
https://github.com/marko-js/marko.git
synced 2025-12-08 19:26:05 +00:00
Marko v3: var name from attr value should be the actual string value
This commit is contained in:
parent
14350fcab4
commit
98b52a3342
@ -32,6 +32,14 @@ function getNestedVariables(elNode, tagDef, codegen) {
|
||||
}
|
||||
varName = elNode.getAttributeValue(attrName);
|
||||
if (varName) {
|
||||
if (varName.type !== 'Literal' || typeof varName.value !== 'string') {
|
||||
codegen.addError('The value of the ' + attrName + ' is expected to be a string');
|
||||
codegen.addError('Attribute ' + possibleNameAttributes.join(' or ') + ' is required');
|
||||
varName = '_var'; // Let it continue with errors
|
||||
}
|
||||
|
||||
varName = varName.value;
|
||||
|
||||
if (!keep) {
|
||||
elNode.removeAttribute(attrName);
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user