From a72955faa29fccd92bef020e95ccf342d7f5e26d Mon Sep 17 00:00:00 2001 From: Rich-Harris Date: Tue, 6 Dec 2016 22:18:49 -0500 Subject: [PATCH] fix typo, disallow multiple style/script tags --- compiler/parse/state/tag.js | 2 +- test/parser/error-multiple-styles/error.json | 8 ++++++++ test/parser/error-multiple-styles/input.html | 13 +++++++++++++ 3 files changed, 22 insertions(+), 1 deletion(-) create mode 100644 test/parser/error-multiple-styles/error.json create mode 100644 test/parser/error-multiple-styles/input.html diff --git a/compiler/parse/state/tag.js b/compiler/parse/state/tag.js index d8ac4fd776..322972abf3 100644 --- a/compiler/parse/state/tag.js +++ b/compiler/parse/state/tag.js @@ -88,7 +88,7 @@ export default function tag ( parser ) { if ( name in specials ) { const special = specials[ name ]; - if ( parser[ special.id ] ) { + if ( parser[ special.property ] ) { parser.index = start; parser.error( `You can only have one <${name}> tag per component` ); } diff --git a/test/parser/error-multiple-styles/error.json b/test/parser/error-multiple-styles/error.json new file mode 100644 index 0000000000..6a8b184ed6 --- /dev/null +++ b/test/parser/error-multiple-styles/error.json @@ -0,0 +1,8 @@ +{ + "message": "You can only have one + +