Skip to content

Commit ca1c38a

Browse files
authored
fix: ignore Intl features and prototype methods in test262-parser tests (#14261)
* fix: ignore Intl features and prototype methods * review comments
1 parent 6b4d466 commit ca1c38a

1 file changed

Lines changed: 11 additions & 38 deletions

File tree

scripts/parser-tests/test262/index.js

Lines changed: 11 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -10,11 +10,6 @@ const ignoredFeatures = new Set([
1010
"__proto__",
1111
"__setter__",
1212
"AggregateError",
13-
"Array.prototype.at",
14-
"Array.prototype.flat",
15-
"Array.prototype.flatMap",
16-
"Array.prototype.item",
17-
"Array.prototype.values",
1813
"ArrayBuffer",
1914
"align-detached-buffer-semantics-with-web-reality",
2015
"arbitrary-module-namespace-names",
@@ -41,14 +36,6 @@ const ignoredFeatures = new Set([
4136
"const",
4237
"cross-realm",
4338
"DataView",
44-
"DataView.prototype.getFloat32",
45-
"DataView.prototype.getFloat64",
46-
"DataView.prototype.getInt8",
47-
"DataView.prototype.getInt16",
48-
"DataView.prototype.getInt32",
49-
"DataView.prototype.getUint16",
50-
"DataView.prototype.getUint32",
51-
"DataView.prototype.setUint8",
5239
"default-parameters",
5340
"destructuring-assignment",
5441
"destructuring-binding",
@@ -70,20 +57,6 @@ const ignoredFeatures = new Set([
7057
"Int16Array",
7158
"Int32Array",
7259
"Intl-enumeration",
73-
"Intl.DateTimeFormat-datetimestyle",
74-
"Intl.DateTimeFormat-dayPeriod",
75-
"Intl.DateTimeFormat-extend-timezonename",
76-
"Intl.DateTimeFormat-fractionalSecondDigits",
77-
"Intl.DateTimeFormat-formatRange",
78-
"Intl.DisplayNames",
79-
"Intl.DisplayNames-v2",
80-
"Intl.ListFormat",
81-
"Intl.Locale",
82-
"Intl.Locale-info",
83-
"Intl.NumberFormat-unified",
84-
"Intl.NumberFormat-v3",
85-
"Intl.RelativeTimeFormat",
86-
"Intl.Segmenter",
8760
"IsHTMLDDA",
8861
"import.meta",
8962
"intl-normative-optional",
@@ -122,14 +95,6 @@ const ignoredFeatures = new Set([
12295
"SharedArrayBuffer",
12396
"Set",
12497
"String.fromCodePoint",
125-
"String.prototype.at",
126-
"String.prototype.endsWith",
127-
"String.prototype.includes",
128-
"String.prototype.item",
129-
"String.prototype.matchAll",
130-
"String.prototype.replaceAll",
131-
"String.prototype.trimEnd",
132-
"String.prototype.trimStart",
13398
"string-trimming",
13499
"super",
135100
"Symbol",
@@ -152,8 +117,6 @@ const ignoredFeatures = new Set([
152117
"top-level-await",
153118
"Temporal",
154119
"TypedArray",
155-
"TypedArray.prototype.at",
156-
"TypedArray.prototype.item",
157120
"u180e",
158121
"Uint8Array",
159122
"Uint8ClampedArray",
@@ -165,6 +128,16 @@ const ignoredFeatures = new Set([
165128
"well-formed-json-stringify",
166129
]);
167130

131+
function featureShouldIgnore(feature) {
132+
return (
133+
ignoredFeatures.has(feature) ||
134+
// All prototype method must not introduce new language syntax
135+
feature.includes(".prototype.") ||
136+
// Ignore Intl features
137+
feature.startsWith("Intl.")
138+
);
139+
}
140+
168141
const ignoredTests = ["built-ins/RegExp/", "language/literals/regexp/"];
169142

170143
const featuresToPlugins = new Map([["import-assertions", "importAssertions"]]);
@@ -177,7 +150,7 @@ function* getPlugins(features) {
177150
for (const f of features) {
178151
if (featuresToPlugins.has(f)) {
179152
yield featuresToPlugins.get(f);
180-
} else if (!ignoredFeatures.has(f)) {
153+
} else if (!featureShouldIgnore(f)) {
181154
unmappedFeatures.add(f);
182155
}
183156
}

0 commit comments

Comments
 (0)