From cd59ed6184160d1f26f3ff275faa18354869e6a0 Mon Sep 17 00:00:00 2001 From: Fernando Jorge Mota Date: Fri, 22 Jun 2018 14:41:12 -0300 Subject: [PATCH] Quote name of attribute to nested components This fixes #887 by quoting name of attributes if those are invalid JS identifiers when passing data to nested components. --- src/compile/nodes/Component.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/compile/nodes/Component.ts b/src/compile/nodes/Component.ts index 736b2306ea..10ba66c413 100644 --- a/src/compile/nodes/Component.ts +++ b/src/compile/nodes/Component.ts @@ -148,7 +148,7 @@ export default class Component extends Node { const attributeObject = usesSpread ? '{}' : stringifyProps( - this.attributes.map(attr => `${attr.name}: ${attr.getValue()}`) + this.attributes.map(attr => `${quoteNameIfNecessary(attr.name)}: ${attr.getValue()}`) ); if (this.attributes.length || this.bindings.length) {