From 09fa21768127474a9aa0682455ebbf68d06baff4 Mon Sep 17 00:00:00 2001 From: Daniel Freedman Date: Thu, 16 Jan 2014 16:02:02 -0800 Subject: [PATCH] Support vertical space between attributes in polymer element definition Add tests for comma and vertical space delimiters Fixes #393 --- src/declaration/attributes.js | 3 ++- test/html/take-attributes.html | 47 ++++++++++++++++++++++++++++++++++ 2 files changed, 49 insertions(+), 1 deletion(-) diff --git a/src/declaration/attributes.js b/src/declaration/attributes.js index 33bfdf7..741ab1e 100644 --- a/src/declaration/attributes.js +++ b/src/declaration/attributes.js @@ -8,6 +8,7 @@ // magic words var ATTRIBUTES_ATTRIBUTE = 'attributes'; + var ATTRIBUTES_REGEX = /\s|,/; // attributes api @@ -25,7 +26,7 @@ // get properties to publish var publish = prototype.publish || (prototype.publish = {}); // names='a b c' or names='a,b,c' - var names = attributes.split(attributes.indexOf(',') >= 0 ? ',' : ' '); + var names = attributes.split(ATTRIBUTES_REGEX); // record each name for publishing for (var i=0, l=names.length, n; i + + + + + + + + + + + + + + + + + + + +