Update Test262, Flow and TS parser tests (#10976)

* Update Test262, Flow and TS parser tests

* Updates
This commit is contained in:
Nicolò Ribaudo
2020-01-10 15:50:11 +01:00
committed by Huáng Jùnliàng
parent e8dac621de
commit bfc56ebbab
4 changed files with 22 additions and 7 deletions

View File

@@ -15,9 +15,11 @@ const flowOptionsMapping = {
};
function getPlugins(test) {
const flowOptions = { all: true };
const plugins = [
"dynamicImport",
["flow", { all: true }],
["flow", flowOptions],
"flowComments",
"jsx",
"classProperties",
@@ -33,6 +35,8 @@ function getPlugins(test) {
if (!enabled) {
const idx = plugins.indexOf(flowOptionsMapping[option]);
if (idx !== -1) plugins.splice(idx, 1);
} else if (option === "enums") {
flowOptions.enums = true;
} else if (!(option in flowOptionsMapping)) {
throw new Error("Parser options not mapped " + option);
} else if (flowOptionsMapping[option]) {