From c6bb49d5541e8f7ea7f73e819a734e31761aadeb Mon Sep 17 00:00:00 2001 From: Patrick Steele-Idem Date: Sat, 16 Apr 2016 16:13:45 -0600 Subject: [PATCH] Fixes #267 - Shorthand CSS class name cannot be combined with object/array class names --- runtime/helpers.js | 47 ++++++++++--------- .../expected.html | 1 + .../template.marko | 1 + .../shorthand-class-plus-class-obj/test.js | 3 ++ 4 files changed, 31 insertions(+), 21 deletions(-) create mode 100644 test/fixtures/render/autotest/shorthand-class-plus-class-obj/expected.html create mode 100644 test/fixtures/render/autotest/shorthand-class-plus-class-obj/template.marko create mode 100644 test/fixtures/render/autotest/shorthand-class-plus-class-obj/test.js diff --git a/runtime/helpers.js b/runtime/helpers.js index f68fb02ba..a5ce6fc2a 100644 --- a/runtime/helpers.js +++ b/runtime/helpers.js @@ -35,14 +35,32 @@ function notEmpty(o) { return true; } -function classListArray(classList) { - var classNames = []; - for (var i=0, len=classList.length; i \ No newline at end of file diff --git a/test/fixtures/render/autotest/shorthand-class-plus-class-obj/template.marko b/test/fixtures/render/autotest/shorthand-class-plus-class-obj/template.marko new file mode 100644 index 000000000..66630c161 --- /dev/null +++ b/test/fixtures/render/autotest/shorthand-class-plus-class-obj/template.marko @@ -0,0 +1 @@ +div.foo class={bar: true, baz: false} \ No newline at end of file diff --git a/test/fixtures/render/autotest/shorthand-class-plus-class-obj/test.js b/test/fixtures/render/autotest/shorthand-class-plus-class-obj/test.js new file mode 100644 index 000000000..89223be5e --- /dev/null +++ b/test/fixtures/render/autotest/shorthand-class-plus-class-obj/test.js @@ -0,0 +1,3 @@ +exports.templateData = { + name: 'Marko' +};