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/1555/head
Fernando Jorge Mota 6 years ago committed by GitHub
parent 17000e38f6
commit c641ce423a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -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) {

Loading…
Cancel
Save