3
0
Fork 0
mirror of https://gitea.com/actions/setup-python.git synced 2024-12-01 14:39:33 +01:00
setup-python/node_modules/acorn/bin/run_test262.js

22 lines
645 B
JavaScript
Raw Normal View History

2019-06-27 03:12:00 +02:00
const fs = require("fs")
const path = require("path")
const run = require("test262-parser-runner")
const parse = require("..").parse
const unsupportedFeatures = [
"BigInt",
"class-fields",
"class-fields-private",
"class-fields-public",
"numeric-separator-literal"
];
run(
(content, {sourceType}) => parse(content, {sourceType, ecmaVersion: 10}),
{
testsDirectory: path.dirname(require.resolve("test262/package.json")),
skip: test => (test.attrs.features && unsupportedFeatures.some(f => test.attrs.features.includes(f))),
whitelist: fs.readFileSync("./bin/test262.whitelist", "utf8").split("\n").filter(v => v)
}
)