Remove unused non262-String-shell.js

This commit is contained in:
André Bargull 2025-04-30 14:15:33 +02:00 committed by Ms2ger
parent fea819475f
commit 0ba71a3fea
49 changed files with 47 additions and 198 deletions

View File

@ -1,64 +0,0 @@
/*---
defines: [runNormalizeTest]
allow_unused: True
---*/
function runNormalizeTest(test) {
function codePointsToString(points) {
return points.map(x => String.fromCodePoint(x)).join("");
}
function stringify(points) {
return points.map(x => x.toString(16)).join();
}
var source = codePointsToString(test.source);
var NFC = codePointsToString(test.NFC);
var NFD = codePointsToString(test.NFD);
var NFKC = codePointsToString(test.NFKC);
var NFKD = codePointsToString(test.NFKD);
var sourceStr = stringify(test.source);
var nfcStr = stringify(test.NFC);
var nfdStr = stringify(test.NFD);
var nfkcStr = stringify(test.NFKC);
var nfkdStr = stringify(test.NFKD);
/* NFC */
assertEq(source.normalize(), NFC, "NFC of " + sourceStr);
assertEq(NFC.normalize(), NFC, "NFC of " + nfcStr);
assertEq(NFD.normalize(), NFC, "NFC of " + nfdStr);
assertEq(NFKC.normalize(), NFKC, "NFC of " + nfkcStr);
assertEq(NFKD.normalize(), NFKC, "NFC of " + nfkdStr);
assertEq(source.normalize(undefined), NFC, "NFC of " + sourceStr);
assertEq(NFC.normalize(undefined), NFC, "NFC of " + nfcStr);
assertEq(NFD.normalize(undefined), NFC, "NFC of " + nfdStr);
assertEq(NFKC.normalize(undefined), NFKC, "NFC of " + nfkcStr);
assertEq(NFKD.normalize(undefined), NFKC, "NFC of " + nfkdStr);
assertEq(source.normalize("NFC"), NFC, "NFC of " + sourceStr);
assertEq(NFC.normalize("NFC"), NFC, "NFC of " + nfcStr);
assertEq(NFD.normalize("NFC"), NFC, "NFC of " + nfdStr);
assertEq(NFKC.normalize("NFC"), NFKC, "NFC of " + nfkcStr);
assertEq(NFKD.normalize("NFC"), NFKC, "NFC of " + nfkdStr);
/* NFD */
assertEq(source.normalize("NFD"), NFD, "NFD of " + sourceStr);
assertEq(NFC.normalize("NFD"), NFD, "NFD of " + nfcStr);
assertEq(NFD.normalize("NFD"), NFD, "NFD of " + nfdStr);
assertEq(NFKC.normalize("NFD"), NFKD, "NFD of " + nfkcStr);
assertEq(NFKD.normalize("NFD"), NFKD, "NFD of " + nfkdStr);
/* NFKC */
assertEq(source.normalize("NFKC"), NFKC, "NFKC of " + sourceStr);
assertEq(NFC.normalize("NFKC"), NFKC, "NFKC of " + nfcStr);
assertEq(NFD.normalize("NFKC"), NFKC, "NFKC of " + nfdStr);
assertEq(NFKC.normalize("NFKC"), NFKC, "NFKC of " + nfkcStr);
assertEq(NFKD.normalize("NFKC"), NFKC, "NFKC of " + nfkdStr);
/* NFKD */
assertEq(source.normalize("NFKD"), NFKD, "NFKD of " + sourceStr);
assertEq(NFC.normalize("NFKD"), NFKD, "NFKD of " + nfcStr);
assertEq(NFD.normalize("NFKD"), NFKD, "NFKD of " + nfdStr);
assertEq(NFKC.normalize("NFKD"), NFKD, "NFKD of " + nfkcStr);
assertEq(NFKD.normalize("NFKD"), NFKD, "NFKD of " + nfkdStr);
}

View File

@ -4,7 +4,7 @@
*/
/*---
includes: [sm/non262.js, sm/non262-shell.js, sm/non262-String-shell.js]
includes: [sm/non262.js, sm/non262-shell.js]
flags:
- noStrict
description: |

View File

@ -4,7 +4,7 @@
*/
/*---
includes: [sm/non262.js, sm/non262-shell.js, sm/non262-String-shell.js]
includes: [sm/non262.js, sm/non262-shell.js]
flags:
- noStrict
description: |

View File

@ -2,7 +2,7 @@
// This code is governed by the BSD license found in the LICENSE file.
/*---
includes: [sm/non262.js, sm/non262-shell.js, sm/non262-String-shell.js, compareArray.js]
includes: [sm/non262.js, sm/non262-shell.js, compareArray.js]
flags:
- noStrict
description: |

View File

@ -2,7 +2,7 @@
// This code is governed by the BSD license found in the LICENSE file.
/*---
includes: [sm/non262.js, sm/non262-shell.js, sm/non262-String-shell.js]
includes: [sm/non262.js, sm/non262-shell.js]
flags:
- noStrict
description: |

View File

@ -2,7 +2,7 @@
// This code is governed by the BSD license found in the LICENSE file.
/*---
includes: [sm/non262.js, sm/non262-shell.js, sm/non262-String-shell.js]
includes: [sm/non262.js, sm/non262-shell.js]
flags:
- noStrict
description: |

View File

@ -2,7 +2,7 @@
// This code is governed by the BSD license found in the LICENSE file.
/*---
includes: [sm/non262.js, sm/non262-shell.js, sm/non262-String-shell.js]
includes: [sm/non262.js, sm/non262-shell.js]
flags:
- noStrict
description: |

View File

@ -4,7 +4,7 @@
*/
/*---
includes: [sm/non262.js, sm/non262-shell.js, sm/non262-String-shell.js]
includes: [sm/non262.js, sm/non262-shell.js]
flags:
- noStrict
description: |

View File

@ -2,7 +2,7 @@
// This code is governed by the BSD license found in the LICENSE file.
/*---
includes: [sm/non262.js, sm/non262-shell.js, sm/non262-String-shell.js]
includes: [sm/non262.js, sm/non262-shell.js]
flags:
- noStrict
description: |

View File

@ -2,7 +2,7 @@
// This code is governed by the BSD license found in the LICENSE file.
/*---
includes: [sm/non262.js, sm/non262-shell.js, sm/non262-String-shell.js]
includes: [sm/non262.js, sm/non262-shell.js]
flags:
- noStrict
description: |

View File

@ -2,7 +2,7 @@
// This code is governed by the BSD license found in the LICENSE file.
/*---
includes: [sm/non262.js, sm/non262-shell.js, sm/non262-String-shell.js, deepEqual.js]
includes: [sm/non262.js, sm/non262-shell.js, deepEqual.js]
flags:
- noStrict
description: |

View File

@ -1,87 +0,0 @@
#!/usr/bin/python -B
""" Usage: make-normalize-generateddata-input.py PATH_TO_MOZILLA_CENTRAL
This script generates test input data for String.prototype.normalize
from intl/icu/source/data/unidata/NormalizationTest.txt
to js/src/tests/non262/String/normalize-generateddata-input.js
"""
import re
import sys
sep_pat = re.compile(" +")
def to_code_list(codes):
return "[" + ", ".join("0x{0}".format(x) for x in re.split(sep_pat, codes)) + "]"
def convert(dir):
ver_pat = re.compile(r"NormalizationTest-([0-9\.]+)\.txt")
part_pat = re.compile("^@(Part([0-9]+) .+)$")
test_pat = re.compile(
"^([0-9A-Fa-f ]+);([0-9A-Fa-f ]+);([0-9A-Fa-f ]+);([0-9A-Fa-f ]+);([0-9A-Fa-f ]+);$"
)
ignore_pat = re.compile("^#|^$")
js_path = "js/src/tests/non262/String/normalize-generateddata-input.js"
txt_path = "intl/icu/source/data/unidata/NormalizationTest.txt"
part_opened = False
not_empty = False
with open("{dir}/{path}".format(dir=dir, path=txt_path), "r") as f:
with open("{dir}/{path}".format(dir=dir, path=js_path), "w") as outf:
for line in f:
m = test_pat.search(line)
if m:
if not_empty:
outf.write(",")
outf.write("\n")
pat = "{{ source: {source}, NFC: {NFC}, NFD: {NFD}, NFKC: {NFKC}, NFKD: {NFKD} }}" # NOQA: E501
outf.write(
pat.format(
source=to_code_list(m.group(1)),
NFC=to_code_list(m.group(2)),
NFD=to_code_list(m.group(3)),
NFKC=to_code_list(m.group(4)),
NFKD=to_code_list(m.group(5)),
)
)
not_empty = True
continue
m = part_pat.search(line)
if m:
desc = m.group(1)
part = m.group(2)
if part_opened:
outf.write("\n];\n")
outf.write("/* {desc} */\n".format(desc=desc))
outf.write("var tests_part{part} = [".format(part=part))
part_opened = True
not_empty = False
continue
m = ver_pat.search(line)
if m:
ver = m.group(1)
outf.write(
"/* created from NormalizationTest-{ver}.txt */\n".format(
ver=ver
)
)
continue
m = ignore_pat.search(line)
if m:
continue
print("Unknown line: {0}".format(line), file=sys.stderr)
if part_opened:
outf.write("\n];\n")
if __name__ == "__main__":
if len(sys.argv) < 2:
print(
"Usage: make-normalize-generateddata-input.py PATH_TO_MOZILLA_CENTRAL",
file=sys.stderr,
)
sys.exit(1)
convert(sys.argv[1])

View File

@ -2,7 +2,7 @@
// This code is governed by the BSD license found in the LICENSE file.
/*---
includes: [sm/non262.js, sm/non262-shell.js, sm/non262-String-shell.js, deepEqual.js]
includes: [sm/non262.js, sm/non262-shell.js, deepEqual.js]
flags:
- noStrict
description: |

View File

@ -4,7 +4,7 @@
*/
/*---
includes: [sm/non262.js, sm/non262-shell.js, sm/non262-String-shell.js]
includes: [sm/non262.js, sm/non262-shell.js]
flags:
- noStrict
description: |

View File

@ -4,7 +4,7 @@
*/
/*---
includes: [sm/non262.js, sm/non262-shell.js, sm/non262-String-shell.js]
includes: [sm/non262.js, sm/non262-shell.js]
flags:
- noStrict
description: |

View File

@ -4,7 +4,7 @@
*/
/*---
includes: [sm/non262.js, sm/non262-shell.js, sm/non262-String-shell.js]
includes: [sm/non262.js, sm/non262-shell.js]
flags:
- noStrict
description: |

View File

@ -4,7 +4,7 @@
*/
/*---
includes: [sm/non262.js, sm/non262-shell.js, sm/non262-String-shell.js]
includes: [sm/non262.js, sm/non262-shell.js]
flags:
- noStrict
description: |

View File

@ -2,7 +2,7 @@
// This code is governed by the BSD license found in the LICENSE file.
/*---
includes: [sm/non262.js, sm/non262-shell.js, sm/non262-String-shell.js]
includes: [sm/non262.js, sm/non262-shell.js]
flags:
- noStrict
description: |

View File

@ -2,7 +2,7 @@
// This code is governed by the BSD license found in the LICENSE file.
/*---
includes: [sm/non262.js, sm/non262-shell.js, sm/non262-String-shell.js, compareArray.js]
includes: [sm/non262.js, sm/non262-shell.js, compareArray.js]
flags:
- noStrict
description: |

View File

@ -2,7 +2,7 @@
// This code is governed by the BSD license found in the LICENSE file.
/*---
includes: [sm/non262.js, sm/non262-shell.js, sm/non262-String-shell.js]
includes: [sm/non262.js, sm/non262-shell.js]
flags:
- noStrict
description: |

View File

@ -2,7 +2,7 @@
// This code is governed by the BSD license found in the LICENSE file.
/*---
includes: [sm/non262.js, sm/non262-shell.js, sm/non262-String-shell.js]
includes: [sm/non262.js, sm/non262-shell.js]
flags:
- noStrict
description: |

View File

@ -2,7 +2,7 @@
// This code is governed by the BSD license found in the LICENSE file.
/*---
includes: [sm/non262.js, sm/non262-shell.js, sm/non262-String-shell.js]
includes: [sm/non262.js, sm/non262-shell.js]
flags:
- noStrict
description: |

View File

@ -2,7 +2,7 @@
// This code is governed by the BSD license found in the LICENSE file.
/*---
includes: [sm/non262.js, sm/non262-shell.js, sm/non262-String-shell.js]
includes: [sm/non262.js, sm/non262-shell.js]
flags:
- noStrict
description: |

View File

@ -2,7 +2,7 @@
// This code is governed by the BSD license found in the LICENSE file.
/*---
includes: [sm/non262.js, sm/non262-shell.js, sm/non262-String-shell.js]
includes: [sm/non262.js, sm/non262-shell.js]
flags:
- noStrict
description: |

View File

@ -2,7 +2,7 @@
// This code is governed by the BSD license found in the LICENSE file.
/*---
includes: [sm/non262.js, sm/non262-shell.js, sm/non262-String-shell.js]
includes: [sm/non262.js, sm/non262-shell.js]
flags:
- noStrict
description: |

View File

@ -2,7 +2,7 @@
// This code is governed by the BSD license found in the LICENSE file.
/*---
includes: [sm/non262.js, sm/non262-shell.js, sm/non262-String-shell.js]
includes: [sm/non262.js, sm/non262-shell.js]
flags:
- noStrict
description: |

View File

@ -2,7 +2,7 @@
// This code is governed by the BSD license found in the LICENSE file.
/*---
includes: [sm/non262.js, sm/non262-shell.js, sm/non262-String-shell.js]
includes: [sm/non262.js, sm/non262-shell.js]
flags:
- noStrict
description: |

View File

@ -2,7 +2,7 @@
// This code is governed by the BSD license found in the LICENSE file.
/*---
includes: [sm/non262.js, sm/non262-shell.js, sm/non262-String-shell.js]
includes: [sm/non262.js, sm/non262-shell.js]
flags:
- noStrict
description: |

View File

@ -2,7 +2,7 @@
// This code is governed by the BSD license found in the LICENSE file.
/*---
includes: [sm/non262.js, sm/non262-shell.js, sm/non262-String-shell.js]
includes: [sm/non262.js, sm/non262-shell.js]
flags:
- noStrict
description: |

View File

@ -4,7 +4,7 @@
*/
/*---
includes: [sm/non262.js, sm/non262-shell.js, sm/non262-String-shell.js]
includes: [sm/non262.js, sm/non262-shell.js]
flags:
- noStrict
description: |

View File

@ -4,7 +4,7 @@
*/
/*---
includes: [sm/non262.js, sm/non262-shell.js, sm/non262-String-shell.js]
includes: [sm/non262.js, sm/non262-shell.js]
flags:
- noStrict
description: |

View File

@ -4,7 +4,7 @@
*/
/*---
includes: [sm/non262.js, sm/non262-shell.js, sm/non262-String-shell.js]
includes: [sm/non262.js, sm/non262-shell.js]
flags:
- noStrict
description: |

View File

@ -2,7 +2,7 @@
// This code is governed by the BSD license found in the LICENSE file.
/*---
includes: [sm/non262.js, sm/non262-shell.js, sm/non262-String-shell.js]
includes: [sm/non262.js, sm/non262-shell.js]
flags:
- noStrict
description: |

View File

@ -2,7 +2,7 @@
// This code is governed by the BSD license found in the LICENSE file.
/*---
includes: [sm/non262.js, sm/non262-shell.js, sm/non262-String-shell.js]
includes: [sm/non262.js, sm/non262-shell.js]
flags:
- noStrict
description: |

View File

@ -2,7 +2,7 @@
// This code is governed by the BSD license found in the LICENSE file.
/*---
includes: [sm/non262.js, sm/non262-shell.js, sm/non262-String-shell.js]
includes: [sm/non262.js, sm/non262-shell.js]
flags:
- noStrict
description: |

View File

@ -2,7 +2,7 @@
// This code is governed by the BSD license found in the LICENSE file.
/*---
includes: [sm/non262.js, sm/non262-shell.js, sm/non262-String-shell.js]
includes: [sm/non262.js, sm/non262-shell.js]
flags:
- noStrict
description: |

View File

@ -4,7 +4,7 @@
*/
/*---
includes: [sm/non262.js, sm/non262-shell.js, sm/non262-String-shell.js]
includes: [sm/non262.js, sm/non262-shell.js]
flags:
- noStrict
description: |

View File

@ -2,7 +2,7 @@
// This code is governed by the BSD license found in the LICENSE file.
/*---
includes: [sm/non262.js, sm/non262-shell.js, sm/non262-String-shell.js, deepEqual.js]
includes: [sm/non262.js, sm/non262-shell.js, deepEqual.js]
flags:
- noStrict
description: |

View File

@ -2,7 +2,7 @@
// This code is governed by the BSD license found in the LICENSE file.
/*---
includes: [sm/non262.js, sm/non262-shell.js, sm/non262-String-shell.js]
includes: [sm/non262.js, sm/non262-shell.js]
flags:
- noStrict
description: |

View File

@ -4,7 +4,7 @@
*/
/*---
includes: [sm/non262.js, sm/non262-shell.js, sm/non262-String-shell.js]
includes: [sm/non262.js, sm/non262-shell.js]
flags:
- noStrict
description: |

View File

@ -2,7 +2,7 @@
// This code is governed by the BSD license found in the LICENSE file.
/*---
includes: [sm/non262.js, sm/non262-shell.js, sm/non262-String-shell.js]
includes: [sm/non262.js, sm/non262-shell.js]
flags:
- noStrict
description: |

View File

@ -2,7 +2,7 @@
// This code is governed by the BSD license found in the LICENSE file.
/*---
includes: [sm/non262.js, sm/non262-shell.js, sm/non262-String-shell.js]
includes: [sm/non262.js, sm/non262-shell.js]
flags:
- noStrict
description: |

View File

@ -4,7 +4,7 @@
*/
/*---
includes: [sm/non262.js, sm/non262-shell.js, sm/non262-String-shell.js]
includes: [sm/non262.js, sm/non262-shell.js]
flags:
- noStrict
description: |

View File

@ -4,7 +4,7 @@
*/
/*---
includes: [sm/non262.js, sm/non262-shell.js, sm/non262-String-shell.js]
includes: [sm/non262.js, sm/non262-shell.js]
flags:
- noStrict
description: |

View File

@ -4,7 +4,7 @@
*/
/*---
includes: [sm/non262.js, sm/non262-shell.js, sm/non262-String-shell.js]
includes: [sm/non262.js, sm/non262-shell.js]
flags:
- noStrict
description: |

View File

@ -4,7 +4,7 @@
*/
/*---
includes: [sm/non262.js, sm/non262-shell.js, sm/non262-String-shell.js]
includes: [sm/non262.js, sm/non262-shell.js]
flags:
- noStrict
description: |

View File

@ -2,7 +2,7 @@
// This code is governed by the BSD license found in the LICENSE file.
/*---
includes: [sm/non262.js, sm/non262-shell.js, sm/non262-String-shell.js]
includes: [sm/non262.js, sm/non262-shell.js]
flags:
- noStrict
description: |

View File

@ -2,7 +2,7 @@
// This code is governed by the BSD license found in the LICENSE file.
/*---
includes: [sm/non262.js, sm/non262-shell.js, sm/non262-String-shell.js]
includes: [sm/non262.js, sm/non262-shell.js]
flags:
- noStrict
description: |

View File

@ -2,7 +2,7 @@
// This code is governed by the BSD license found in the LICENSE file.
/*---
includes: [sm/non262.js, sm/non262-shell.js, sm/non262-String-shell.js]
includes: [sm/non262.js, sm/non262-shell.js]
flags:
- noStrict
description: |