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.
pull/7738/head
Fernando Jorge Mota 7 years ago committed by GitHub
parent 64afea3551
commit cd59ed6184

@ -148,7 +148,7 @@ export default class Component extends Node {
const attributeObject = usesSpread const attributeObject = usesSpread
? '{}' ? '{}'
: stringifyProps( : 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) { if (this.attributes.length || this.bindings.length) {

Loading…
Cancel
Save