pull/6898/head
tanhauhau 4 years ago
parent 0ef1dfca7a
commit 13c6c12ab7

@ -189,6 +189,9 @@ export default function tag(parser: Parser) {
} }
const definition = element.attributes.splice(index, 1)[0]; const definition = element.attributes.splice(index, 1)[0];
if (definition.value === true) {
parser.error(parser_errors.invalid_element_definition, definition.start);
}
element.tag = definition.value[0].data || definition.value[0].expression; element.tag = definition.value[0].data || definition.value[0].expression;
} }

@ -7,26 +7,24 @@ export default {
props: { props: {
logs logs
}, },
before_test() { after_test() {
logs = []; logs = [];
}, },
async test({ assert, component, target }) { async test({ assert, component, target }) {
assert.equal(component.tag, 'h1'); assert.equal(component.tag, 'h1');
assert.equal(component.updateText, '');
assert.equal(component.destroyText, '');
assert.deepEqual(logs, ['create: h1,opt2']); assert.deepEqual(logs, ['create: h1,opt1']);
component.opt = 'opt2'; component.opt = 'opt2';
assert.equal(component.tag, 'h1'); assert.equal(component.tag, 'h1');
assert.deepEqual(logs, ['create: h1,opt2', 'update: h1,opt2']); assert.deepEqual(logs, ['create: h1,opt1', 'update: h1,opt2']);
component.tag = 'h2'; component.tag = 'h2';
assert.equal(component.tag, 'h2'); assert.equal(component.tag, 'h2');
assert.deepEqual(logs, [ assert.deepEqual(logs, [
'create: h1,opt2', 'create: h1,opt1',
'update: h1,opt2', 'update: h1,opt2',
'destroy', 'destroy',
'create: h2,opt2' 'create: h2,opt2'
@ -35,7 +33,7 @@ export default {
component.tag = false; component.tag = false;
assert.deepEqual(logs, [ assert.deepEqual(logs, [
'create: h1,opt2', 'create: h1,opt1',
'update: h1,opt2', 'update: h1,opt2',
'destroy', 'destroy',
'create: h2,opt2', 'create: h2,opt2',

Loading…
Cancel
Save