From 796b1faca112390ab9732e5f9aea826abb110e5a Mon Sep 17 00:00:00 2001 From: pushkine Date: Mon, 11 Jan 2021 11:00:43 +0100 Subject: [PATCH 1/2] init --- src/compiler/parse/state/tag.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/compiler/parse/state/tag.ts b/src/compiler/parse/state/tag.ts index efeb9433bc8e..696a47b649fc 100644 --- a/src/compiler/parse/state/tag.ts +++ b/src/compiler/parse/state/tag.ts @@ -376,7 +376,7 @@ function read_attribute(parser: Parser, unique_names: Set) { if (type === 'Binding' && directive_name !== 'this') { check_unique(directive_name); - } else if (type !== 'EventHandler') { + } else if (type !== 'EventHandler' && type !== 'Action') { check_unique(name); } From 1903a74da46f5132b186b12e6f133b075eda13c5 Mon Sep 17 00:00:00 2001 From: pushkine Date: Mon, 11 Jan 2021 11:24:08 +0100 Subject: [PATCH 2/2] test --- .../samples/action-duplicate/input.svelte | 1 + .../samples/action-duplicate/output.json | 34 +++++++++++++++++++ 2 files changed, 35 insertions(+) create mode 100644 test/parser/samples/action-duplicate/input.svelte create mode 100644 test/parser/samples/action-duplicate/output.json diff --git a/test/parser/samples/action-duplicate/input.svelte b/test/parser/samples/action-duplicate/input.svelte new file mode 100644 index 000000000000..11b251548322 --- /dev/null +++ b/test/parser/samples/action-duplicate/input.svelte @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/test/parser/samples/action-duplicate/output.json b/test/parser/samples/action-duplicate/output.json new file mode 100644 index 000000000000..30469ceb4881 --- /dev/null +++ b/test/parser/samples/action-duplicate/output.json @@ -0,0 +1,34 @@ +{ + "html": { + "start": 0, + "end": 35, + "type": "Fragment", + "children": [ + { + "start": 0, + "end": 35, + "type": "Element", + "name": "input", + "attributes": [ + { + "start": 7, + "end": 20, + "type": "Action", + "name": "autofocus", + "modifiers": [], + "expression": null + }, + { + "start": 21, + "end": 34, + "type": "Action", + "name": "autofocus", + "modifiers": [], + "expression": null + } + ], + "children": [] + } + ] + } +} \ No newline at end of file