Skip to content

Commit

Permalink
Update test262 parser tests ignoredFeatures list (#14019)
Browse files Browse the repository at this point in the history
  • Loading branch information
nicolo-ribaudo committed Dec 3, 2021
1 parent 2597184 commit 578ab22
Showing 1 changed file with 26 additions and 12 deletions.
38 changes: 26 additions & 12 deletions scripts/parser-tests/test262/index.js
Expand Up @@ -5,8 +5,9 @@ import TestRunner from "../utils/parser-test-runner.js";

const dirname = path.dirname(fileURLToPath(import.meta.url));

const ignoredFeatures = [
const ignoredFeatures = new Set([
"__getter__",
"__proto__",
"__setter__",
"AggregateError",
"Array.prototype.at",
Expand All @@ -17,6 +18,7 @@ const ignoredFeatures = [
"ArrayBuffer",
"align-detached-buffer-semantics-with-web-reality",
"arbitrary-module-namespace-names",
"array-find-from-last",
"async-functions",
"async-iteration",
"arrow-function",
Expand All @@ -26,8 +28,10 @@ const ignoredFeatures = [
"caller",
"class",
"class-fields-private",
"class-fields-private-in",
"class-fields-public",
"class-methods-private",
"class-static-block",
"class-static-fields-private",
"class-static-fields-public",
"class-static-methods-private",
Expand All @@ -49,6 +53,7 @@ const ignoredFeatures = [
"destructuring-assignment",
"destructuring-binding",
"dynamic-import",
"error-cause",
"export-star-as-namespace-from-module",
"FinalizationGroup",
"FinalizationRegistry",
Expand All @@ -64,19 +69,25 @@ const ignoredFeatures = [
"Int8Array",
"Int16Array",
"Int32Array",
"Intl-enumeration",
"Intl.DateTimeFormat-datetimestyle",
"Intl.DateTimeFormat-dayPeriod",
"Intl.DateTimeFormat-extend-timezonename",
"Intl.DateTimeFormat-fractionalSecondDigits",
"Intl.DateTimeFormat-formatRange",
"Intl.DisplayNames",
"Intl.DisplayNames-v2",
"Intl.ListFormat",
"Intl.Locale",
"Intl.Locale-info",
"Intl.NumberFormat-unified",
"Intl.NumberFormat-v3",
"Intl.RelativeTimeFormat",
"Intl.Segmenter",
"IsHTMLDDA",
"import.meta",
"intl-normative-optional",
"json-modules",
"json-superset",
"legacy-regexp",
"let",
Expand All @@ -85,6 +96,7 @@ const ignoredFeatures = [
"new.target",
"numeric-separator-literal",
"Object.fromEntries",
"Object.hasOwn",
"Object.is",
"object-rest",
"object-spread",
Expand All @@ -104,7 +116,9 @@ const ignoredFeatures = [
"regexp-lookbehind",
"regexp-named-groups",
"regexp-unicode-property-escapes",
"resizable-arraybuffer",
"rest-parameters",
"ShadowRealm",
"SharedArrayBuffer",
"Set",
"String.fromCodePoint",
Expand Down Expand Up @@ -136,6 +150,7 @@ const ignoredFeatures = [
"tail-call-optimization",
"template",
"top-level-await",
"Temporal",
"TypedArray",
"TypedArray.prototype.at",
"TypedArray.prototype.item",
Expand All @@ -148,24 +163,21 @@ const ignoredFeatures = [
"WeakSet",
"WeakRef",
"well-formed-json-stringify",
];
]);

const ignoredTests = ["built-ins/RegExp/", "language/literals/regexp/"];

const featuresToPlugins = {
__proto__: null,
"import-assertions": "importAssertions",
};
const featuresToPlugins = new Map([["import-assertions", "importAssertions"]]);

const unmappedFeatures = new Set();

function* getPlugins(features) {
if (!features) return;

for (const f of features) {
if (featuresToPlugins[f]) {
yield featuresToPlugins[f];
} else if (!ignoredFeatures.includes(f)) {
if (featuresToPlugins.has(f)) {
yield featuresToPlugins.get(f);
} else if (!ignoredFeatures.has(f)) {
unmappedFeatures.add(f);
}
}
Expand Down Expand Up @@ -207,13 +219,15 @@ runner
.run()
.then(() => {
if (unmappedFeatures.size) {
console.log("");
console.log(
console.warn("");
console.warn(
"The following Features are not currently mapped or ignored:"
);
console.log(
console.warn(
Array.from(unmappedFeatures).join("\n").replace(/^/gm, " ")
);

process.exitCode = 1;
}
})
.catch(err => {
Expand Down

0 comments on commit 578ab22

Please sign in to comment.