From 432542bbcc5b78e17d38017fd87668922bf24811 Mon Sep 17 00:00:00 2001 From: Jermolene Date: Mon, 5 Jun 2017 16:12:43 +0100 Subject: [PATCH] Don't throw errors when hitting limits of the fakedom --- core/modules/utils/fakedom.js | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/core/modules/utils/fakedom.js b/core/modules/utils/fakedom.js index 05a500fa3..4a756f43d 100755 --- a/core/modules/utils/fakedom.js +++ b/core/modules/utils/fakedom.js @@ -224,8 +224,7 @@ Object.defineProperty(TW_Element.prototype, "textContent", { get: function() { if(this.isRaw) { if(this.rawTextContent === null) { - console.log(booboo) - throw "Cannot get textContent on a raw TW_Element"; + return ""; } else { return this.rawTextContent; } @@ -245,7 +244,7 @@ Object.defineProperty(TW_Element.prototype, "textContent", { Object.defineProperty(TW_Element.prototype, "formattedTextContent", { get: function() { if(this.isRaw) { - throw "Cannot get formattedTextContent on a raw TW_Element"; + return ""; } else { var b = [], isBlock = $tw.config.htmlBlockElements.indexOf(this.tag) !== -1;