Update test262 and flow tests (#7925)

This commit is contained in:
Nicolò Ribaudo
2018-05-14 19:26:28 +02:00
committed by Brian Ng
parent e06cf20d2e
commit ba11d9fa7c
5 changed files with 86 additions and 13 deletions

View File

@@ -31,3 +31,20 @@ types/member/reserved_words.js
types/parameter_defaults/migrated_0032.js
types/typecasts_invalid/migrated_0001.js
class_method_kinds/polymorphic_getter.js
internal_slot/interface_method.js
internal_slot/object_method.js
internal_slot/object_variance.js
numbers/underscored_bin.js
numbers/underscored_float.js
numbers/underscored_float_whole.js
numbers/underscored_hex.js
numbers/underscored_number.js
numbers/underscored_oct.js
typeapp_call/function_call.js
typeapp_call/function_call_optional.js
typeapp_call/method_call.js
typeapp_call/method_call_computed.js
typeapp_call/method_call_optional2.js
typeapp_call/new.js
typeapp_call/new_noparens.js
types/declare_class/proto.js

View File

@@ -83,18 +83,27 @@ function update_whitelist(summary) {
const contains = (tests, file) =>
tests.some(({ test }) => test.file === file);
const result = fs
const disallowed = summary.disallowed.success.concat(
summary.disallowed.failure
);
const oldLines = fs
.readFileSync(WHITELIST_PATH, "utf8")
.trim()
.split("\n")
.filter(line => {
const file = line.replace(/#.*$/, "").trim();
return (
!contains(summary.disallowed.success, file) &&
!contains(summary.disallowed.failure, file) &&
summary.unrecognized.indexOf(file) === -1
!contains(disallowed, file) && summary.unrecognized.indexOf(file) === -1
);
})
.join("\n");
});
const newLines = disallowed
.map(({ test }) => test.file)
.filter(test => oldLines.indexOf(test) === -1);
const result = oldLines.concat(newLines).join("\n") + "\n";
fs.writeFileSync(WHITELIST_PATH, result);
}
@@ -116,6 +125,7 @@ const flowOptionsMapping = {
esproposal_class_static_fields: "classProperties",
esproposal_export_star_as: "exportNamespaceFrom",
esproposal_decorators: "decorators-legacy",
esproposal_nullish_coalescing: "nullishCoalescingOperator",
esproposal_optional_chaining: "optionalChaining",
types: "flowComments",
};