Skip to content
This repository was archived by the owner on Apr 22, 2020. It is now read-only.

Commit 752ca02

Browse files
author
mikesamuel@gmail.com
committed
fixed test element cloning in tests to work on IE which does not support removeAttribute("class")
1 parent 6a22192 commit 752ca02

3 files changed

Lines changed: 9 additions & 7 deletions

File tree

js-modules/extractSourceSpans_test.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
<html> <head>
33
<title>Extract Source Spans Test</title>
44
<script src="extractSourceSpans.js"></script>
5-
<script src="https://github.com/douglascrockford/JSON-js/raw/master/json2.js"></script>
5+
<script src="http://github.com/douglascrockford/JSON-js/raw/master/json2.js"></script>
66
<style>
77
.ok { background: #dfd }
88
.error, .failure { background: #fdd }
@@ -118,5 +118,5 @@ <h1>Extract Source Spans Test</h1>
118118

119119
<hr>
120120
<address></address>
121-
<!-- hhmts start --> Last modified: Tue Mar 29 15:46:03 PDT 2011 <!-- hhmts end -->
121+
<!-- hhmts start --> Last modified: Tue Mar 29 15:47:29 PDT 2011 <!-- hhmts end -->
122122
</body> </html>

js-modules/numberLines_test.html

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
<html> <head>
33
<title>Number Lines Test</title>
44
<script src="numberLines.js"></script>
5-
<script src="https://github.com/douglascrockford/JSON-js/raw/master/json2.js"></script>
5+
<script src="http://github.com/douglascrockford/JSON-js/raw/master/json2.js"></script>
66
<style>
77
.ok { background: #dfd }
88
.error, .failure { background: #fdd }
@@ -88,7 +88,8 @@ <h1>Number Lines Test</h1>
8888
testResult.parentNode.appendChild(actual);
8989
try {
9090
var testInputClone = testInput.cloneNode(true);
91-
testInputClone.removeAttribute('class');
91+
testInputClone.className = ''; // IE
92+
testInputClone.removeAttribute('class'); // Not IE.
9293
actual.appendChild(testInputClone);
9394
numberLines(testInputClone);
9495
var passed = testResult.innerHTML === actual.innerHTML;
@@ -106,5 +107,5 @@ <h1>Number Lines Test</h1>
106107

107108
<hr>
108109
<address></address>
109-
<!-- hhmts start --> Last modified: Tue Mar 29 15:46:10 PDT 2011 <!-- hhmts end -->
110+
<!-- hhmts start --> Last modified: Tue Mar 29 15:52:29 PDT 2011 <!-- hhmts end -->
110111
</body> </html>

js-modules/recombineTagsAndDecorations_test.html

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
<script src="extractSourceSpans.js"></script>
55
<script src="numberLines.js"></script>
66
<script src="recombineTagsAndDecorations.js"></script>
7-
<script src="https://github.com/douglascrockford/JSON-js/raw/master/json2.js"></script>
7+
<script src="http://github.com/douglascrockford/JSON-js/raw/master/json2.js"></script>
88
<link rel="stylesheet" href="../src/prettify.css" type="text/css" />
99
<style>
1010
.ok { background: #dfd }
@@ -71,7 +71,8 @@ <h1>Recombine Tags And Decorations</h1>
7171
var actual = document.createElement('TD');
7272
testResult.parentNode.appendChild(actual);
7373
var clone = testInput.cloneNode(true);
74-
clone.removeAttribute('class');
74+
clone.className = ''; // IE
75+
clone.removeAttribute('class'); // Not IE.
7576
actual.appendChild(clone);
7677
var job = extractSourceSpans(clone);
7778
job.decorations = eval(decorationsNode.innerText || decorationsNode.textContent);

0 commit comments

Comments
 (0)