diff options
Diffstat (limited to 'deps/acorn/bin/run_test262.js')
-rw-r--r-- | deps/acorn/bin/run_test262.js | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/deps/acorn/bin/run_test262.js b/deps/acorn/bin/run_test262.js new file mode 100644 index 0000000000..150429a1f2 --- /dev/null +++ b/deps/acorn/bin/run_test262.js @@ -0,0 +1,21 @@ +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) + } +) |