From 168babe25b80ccba84ddd0c2c868630399ec9bd0 Mon Sep 17 00:00:00 2001 From: Conduitry Date: Sun, 19 Mar 2017 04:45:25 -0400 Subject: [PATCH] only do special reserved name handling when tag is all lowercase letters --- src/parse/read/expression.js | 2 +- .../generator/samples/attribute-dynamic-reserved/_config.js | 6 +++--- test/generator/samples/attribute-dynamic-reserved/main.html | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/parse/read/expression.js b/src/parse/read/expression.js index 61cebc9cc7..110b6af4ef 100644 --- a/src/parse/read/expression.js +++ b/src/parse/read/expression.js @@ -4,7 +4,7 @@ export default function readExpression ( parser ) { const start = parser.index; const name = parser.readUntil( /\s*}}/ ); - if ( name && /^\w+$/.test( name ) ) { + if ( name && /^[a-z]+$/.test( name ) ) { return { type: 'Identifier', start, diff --git a/test/generator/samples/attribute-dynamic-reserved/_config.js b/test/generator/samples/attribute-dynamic-reserved/_config.js index e14059fec0..e0e349b7bc 100644 --- a/test/generator/samples/attribute-dynamic-reserved/_config.js +++ b/test/generator/samples/attribute-dynamic-reserved/_config.js @@ -3,12 +3,12 @@ export default { class: 'foo' }, - html: `
`, + html: `
123`, test ( assert, component, target ) { component.set({ class: 'bar' }); - assert.equal( target.innerHTML, `
` ); - + assert.equal( target.innerHTML, `
123` ); + component.destroy(); } }; diff --git a/test/generator/samples/attribute-dynamic-reserved/main.html b/test/generator/samples/attribute-dynamic-reserved/main.html index 6b149d165f..47185118e2 100644 --- a/test/generator/samples/attribute-dynamic-reserved/main.html +++ b/test/generator/samples/attribute-dynamic-reserved/main.html @@ -1 +1 @@ -
\ No newline at end of file +
{{123}}