From 578ab22fb753c3bd41d5a6deb8eaadc1837fc0cd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nicol=C3=B2=20Ribaudo?= Date: Fri, 3 Dec 2021 15:06:42 +0100 Subject: [PATCH] Update `test262` parser tests `ignoredFeatures` list (#14019) --- scripts/parser-tests/test262/index.js | 38 ++++++++++++++++++--------- 1 file changed, 26 insertions(+), 12 deletions(-) diff --git a/scripts/parser-tests/test262/index.js b/scripts/parser-tests/test262/index.js index cd6c24693f..07f1f50f37 100644 --- a/scripts/parser-tests/test262/index.js +++ b/scripts/parser-tests/test262/index.js @@ -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", @@ -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", @@ -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", @@ -49,6 +53,7 @@ const ignoredFeatures = [ "destructuring-assignment", "destructuring-binding", "dynamic-import", + "error-cause", "export-star-as-namespace-from-module", "FinalizationGroup", "FinalizationRegistry", @@ -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", @@ -85,6 +96,7 @@ const ignoredFeatures = [ "new.target", "numeric-separator-literal", "Object.fromEntries", + "Object.hasOwn", "Object.is", "object-rest", "object-spread", @@ -104,7 +116,9 @@ const ignoredFeatures = [ "regexp-lookbehind", "regexp-named-groups", "regexp-unicode-property-escapes", + "resizable-arraybuffer", "rest-parameters", + "ShadowRealm", "SharedArrayBuffer", "Set", "String.fromCodePoint", @@ -136,6 +150,7 @@ const ignoredFeatures = [ "tail-call-optimization", "template", "top-level-await", + "Temporal", "TypedArray", "TypedArray.prototype.at", "TypedArray.prototype.item", @@ -148,14 +163,11 @@ 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(); @@ -163,9 +175,9 @@ 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); } } @@ -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 => {