From 489e6a161f6b03191a325254a7fefa4f8425d575 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Aleksander=20=C5=81ukasz?= Date: Mon, 7 Oct 2013 16:38:21 +0200 Subject: [PATCH 1/1] changing wlxml.WLXMLElementNode.getMEtaAttributes api --- src/wlxml/wlxml.js | 4 ++-- src/wlxml/wlxml.test.js | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/wlxml/wlxml.js b/src/wlxml/wlxml.js index 1619e57..3195efa 100644 --- a/src/wlxml/wlxml.js +++ b/src/wlxml/wlxml.js @@ -22,10 +22,10 @@ $.extend(WLXMLElementNode.prototype, smartxml.ElementNode.prototype, { return this.getAttr('class'); }, getMetaAttributes: function() { - var toret = {}; + var toret = []; this.getAttrs().forEach(function(attr) { if(isMetaAttribute(attr.name)) { - toret[attr.name.substr(5)] = attr.value; + toret.push({name: attr.name.substr(5), value: attr.value}); } }); return toret; diff --git a/src/wlxml/wlxml.test.js b/src/wlxml/wlxml.test.js index 804e37e..9bca9f0 100644 --- a/src/wlxml/wlxml.test.js +++ b/src/wlxml/wlxml.test.js @@ -24,7 +24,7 @@ describe('WLXMLDocument', function() { it('returns its attributes as dict', function() { var node = nodeFromXML(''); - expect(node.getMetaAttributes()).to.eql({attr1: 'val1', attr2: 'val2'}); + expect(node.getMetaAttributes()).to.eql([{name: 'attr1', value: 'val1'}, {name: 'attr2', value: 'val2'}]); }); it('returns attributes other than class and meta-* as other attributes', function() { -- 2.20.1