From 2eb645e5e5731eafba3ab87e3857565a27f68051 Mon Sep 17 00:00:00 2001 From: Jermolene Date: Mon, 10 Aug 2015 20:32:13 +0100 Subject: [PATCH] Add getAttribute to fakeDom --- core/modules/utils/fakedom.js | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/core/modules/utils/fakedom.js b/core/modules/utils/fakedom.js index 1dc8cd45f..8ca1fcb04 100755 --- a/core/modules/utils/fakedom.js +++ b/core/modules/utils/fakedom.js @@ -49,6 +49,13 @@ Object.defineProperty(TW_Element.prototype, "nodeType", { } }); +TW_Element.prototype.getAttribute = function(name) { + if(this.isRaw) { + throw "Cannot getAttribute on a raw TW_Element"; + } + return this.attributes[name]; +}; + TW_Element.prototype.setAttribute = function(name,value) { if(this.isRaw) { throw "Cannot setAttribute on a raw TW_Element";