From 49347e0cf966ef8bf819c413174dcdc5ffa26805 Mon Sep 17 00:00:00 2001 From: jugglinmike Date: Wed, 25 Aug 2021 16:13:00 -0400 Subject: [PATCH] Remove unreachable code (#3165) * Remove unreachable code * fixup! Remove unreachable code --- test/built-ins/decodeURI/S15.1.3.1_A2.1_T1.js | 10 ---------- .../decodeURIComponent/S15.1.3.2_A2.1_T1.js | 10 ---------- test/built-ins/parseFloat/S15.1.2.3_A2_T10.js | 15 --------------- test/language/comments/S7.4_A5.js | 11 ----------- test/language/comments/S7.4_A6.js | 10 ---------- 5 files changed, 56 deletions(-) diff --git a/test/built-ins/decodeURI/S15.1.3.1_A2.1_T1.js b/test/built-ins/decodeURI/S15.1.3.1_A2.1_T1.js index 8b501fd195..418e5a8c2d 100644 --- a/test/built-ins/decodeURI/S15.1.3.1_A2.1_T1.js +++ b/test/built-ins/decodeURI/S15.1.3.1_A2.1_T1.js @@ -8,9 +8,6 @@ description: Complex tests includes: [decimalToHexString.js] ---*/ -//CHECK -var errorCount = 0; -var count = 0; for (var indexI = 0; indexI <= 65535; indexI++) { if (indexI !== 0x25) { var hex = decimalToHexString(indexI); @@ -18,16 +15,9 @@ for (var indexI = 0; indexI <= 65535; indexI++) { var str = String.fromCharCode(indexI); if (decodeURI(str) !== str) { throw new Test262Error('#' + hex + ' '); - errorCount++; } } catch (e) { throw new Test262Error('#' + hex + ' '); - errorCount++; } - count++; } } - -if (errorCount > 0) { - throw new Test262Error('Total error: ' + errorCount + ' bad Unicode character in ' + count); -} diff --git a/test/built-ins/decodeURIComponent/S15.1.3.2_A2.1_T1.js b/test/built-ins/decodeURIComponent/S15.1.3.2_A2.1_T1.js index 5a784f681f..e41e8efbbc 100644 --- a/test/built-ins/decodeURIComponent/S15.1.3.2_A2.1_T1.js +++ b/test/built-ins/decodeURIComponent/S15.1.3.2_A2.1_T1.js @@ -8,9 +8,6 @@ description: Complex tests includes: [decimalToHexString.js] ---*/ -//CHECK -var errorCount = 0; -var count = 0; for (var indexI = 0; indexI <= 65535; indexI++) { if (indexI !== 0x25) { var hex = decimalToHexString(indexI); @@ -18,16 +15,9 @@ for (var indexI = 0; indexI <= 65535; indexI++) { var str = String.fromCharCode(indexI); if (decodeURIComponent(str) !== str) { throw new Test262Error('#' + hex + ' '); - errorCount++; } } catch (e) { throw new Test262Error('#' + hex + ' '); - errorCount++; } - count++; } } - -if (errorCount > 0) { - throw new Test262Error('Total error: ' + errorCount + ' bad Unicode character in ' + count); -} diff --git a/test/built-ins/parseFloat/S15.1.2.3_A2_T10.js b/test/built-ins/parseFloat/S15.1.2.3_A2_T10.js index 9cdeb08203..6d52fac2c1 100644 --- a/test/built-ins/parseFloat/S15.1.2.3_A2_T10.js +++ b/test/built-ins/parseFloat/S15.1.2.3_A2_T10.js @@ -9,32 +9,17 @@ description: "StrWhiteSpaceChar :: USP" //CHECK# var n; -var count = 0; -var errorCount = 0; var uspU = ["\u1680", "\u2000", "\u2001", "\u2002", "\u2003", "\u2004", "\u2005", "\u2006", "\u2007", "\u2008", "\u2009", "\u200A", "\u202F", "\u205F", "\u3000"]; var uspS = ["1680", "2000", "2001", "2002", "2003", "2004", "2005", "2006", "2007", "2008", "2009", "200A", "202F", "205F", "3000"]; for (var index = 0; index < uspU.length; index++) { - var result = true; - n = false; if (parseFloat(uspU[index] + "1.1") !== parseFloat("1.1")) { throw new Test262Error('#1.' + uspS[index] + ' '); - result = false; } if (parseFloat(uspU[index] + uspU[index] + uspU[index] + "1.1") !== parseFloat("1.1")) { throw new Test262Error('#2.' + uspS[index] + ' '); - result = false; } n = parseFloat(uspU[index]); if (!(n !== n)) { throw new Test262Error('#3.' + uspS[index] + ' '); - result = false; } - if (result !== true) { - errorCount++; - } - count++; -} - -if (errorCount > 0) { - throw new Test262Error('Total error: ' + errorCount + ' bad Unicode character in ' + count); } diff --git a/test/language/comments/S7.4_A5.js b/test/language/comments/S7.4_A5.js index e369d84901..9bb6a61484 100644 --- a/test/language/comments/S7.4_A5.js +++ b/test/language/comments/S7.4_A5.js @@ -11,9 +11,6 @@ description: > characters ---*/ -//CHECK -var errorCount = 0; -var count = 0; var hex = ["0", "1", "2", "3", "4", "5", "6", "7", "8", "9", "A", "B", "C", "D", "E", "F"]; for (var i1 = 0; i1 < 16; i1++) { for (var i2 = 0; i2 < 16; i2++) { @@ -28,24 +25,16 @@ for (var i1 = 0; i1 < 16; i1++) { if (LineTerminators !== true) { if (yy !== 0) { throw new Test262Error('#' + uu + ' '); - errorCount++; } } else { if (yy !== -1) { throw new Test262Error('#' + uu + ' '); - errorCount++; } } } catch (e){ throw new Test262Error('#' + uu + ' '); - errorCount++; } - count++; } } } } - -if (errorCount > 0) { - throw new Test262Error('Total error: ' + errorCount + ' bad Unicode character in ' + count); -} diff --git a/test/language/comments/S7.4_A6.js b/test/language/comments/S7.4_A6.js index 3dd7663fab..7042b7b5bc 100644 --- a/test/language/comments/S7.4_A6.js +++ b/test/language/comments/S7.4_A6.js @@ -9,9 +9,6 @@ es5id: 7.4_A6 description: "\"var\"+ yy+ \"xx = 1\", insert instead of yy all Unicode characters" ---*/ -//CHECK -var errorCount = 0; -var count = 0; for (var indexI = 0; indexI <= 65535; indexI++) { try { var xx = 0; @@ -19,17 +16,10 @@ for (var indexI = 0; indexI <= 65535; indexI++) { var hex = decimalToHexString(indexI); if (xx !== 0) { throw new Test262Error('#' + hex + ' '); - errorCount++; } } catch (e){ throw new Test262Error('#' + hex + ' '); - errorCount++; } - count++; -} - -if (errorCount > 0) { - throw new Test262Error('Total error: ' + errorCount + ' bad Unicode character in ' + count); } function decimalToHexString(n) {