From f8b0f4ec6dce942d28d06c689ff97c35d213fc61 Mon Sep 17 00:00:00 2001 From: Jeff Walden Date: Wed, 27 Jul 2016 23:02:29 -0700 Subject: [PATCH] Bug 1280362 - Remove DocumentWrite and htmlesc as unused. r=arai --HG-- extra : rebase_source : 8343509b1250ab440e18c516748031687063f65b --- js/src/tests/browser.js | 30 ------------------------------ 1 file changed, 30 deletions(-) diff --git a/js/src/tests/browser.js b/js/src/tests/browser.js index 4011cdbfd108..9d257d288168 100644 --- a/js/src/tests/browser.js +++ b/js/src/tests/browser.js @@ -30,7 +30,6 @@ var documentBody = global.document.body; var documentDocumentElement = global.document.documentElement; var DocumentCreateElement = global.document.createElement; - var HTMLDocumentPrototypeWrite = global.HTMLDocument.prototype.write; var ElementInnerHTMLSetter = ObjectGetOwnPropertyDescriptor(global.Element.prototype, "innerHTML").set; var HTMLIFramePrototypeContentWindowGetter = @@ -64,10 +63,6 @@ ReflectApply(HTMLElementPrototypeSetAttribute, element, [name, value]); } - function SetInnerHTML(element, html) { - ReflectApply(ElementInnerHTMLSetter, element, [html]); - } - function SetTextContent(element, text) { ReflectApply(NodePrototypeTextContentSetter, element, [text]); } @@ -92,21 +87,6 @@ global.newGlobal = newGlobal; } - // This function is *only* used in this file! Ultimately it should only be - // used by other exports in this IIFE, but for now just export it so that - // functions not exported within this IIFE (but still in this file) can use - // it. - function DocumentWrite(s) { - try { - var msgDiv = CreateElement('div'); - SetInnerHTML(msgDiv, s); - AppendChild(documentBody, msgDiv); - } catch (e) { - ReflectApply(HTMLDocumentPrototypeWrite, document, [s + "
\n"]); - } - } - global.DocumentWrite = DocumentWrite; - // This function is *only* used by this file's |print()| function! It's only // defined/exported here because |print| is defined outside this IIFE and // because it needs access to unadulterated functionality as originally @@ -203,16 +183,6 @@ function setRestoreFunction(restore) { jstestsRestoreFunction = restore; } -function htmlesc(str) { - if (str == '<') - return '<'; - if (str == '>') - return '>'; - if (str == '&') - return '&'; - return str; -} - function print() { var s = 'TEST-INFO | '; var a;