Skip to content

Commit

Permalink
chore: update ecmascript tests
Browse files Browse the repository at this point in the history
  • Loading branch information
styfle committed Jun 3, 2021
1 parent 05995af commit f5ea13a
Show file tree
Hide file tree
Showing 8 changed files with 8,686 additions and 3,620 deletions.
15 changes: 11 additions & 4 deletions test/ecmascript.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,14 +21,21 @@ const ignoreCategories = new Set([
'partial application syntax',
'Object.freeze and Object.seal syntax',
'Class and Property Decorators',
'the pipeline operator',
'Generator function.sent Meta Property',
'Logical Assignment',
'private class methods',
'Class static initialization blocks',
'Ergonomic brand checks for private fields',
'numeric separators',
]);

async function runTests(importPath) {
const { tests } = require(importPath);
for (const t in tests) {
for (const st in tests[t].subtests) {
const category = tests[t];
const { name, exec } = category.subtests[st];
for (const category of tests) {
const subtests = category.subtests || [category]
for (const test of subtests) {
const { name, exec } = test;
if (ignoreCategories.has(category.name)) {
continue;
}
Expand Down
3 changes: 2 additions & 1 deletion test/ecmascript/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,9 @@ In our case, we only need to test parsing and not actually execute the tests.
You can run the following script from this directory to update this test suite.

```sh
curl -L -o data-common.js https://raw.githubusercontent.com/kangax/compat-table/gh-pages/data-common.js
curl -L -o data-common.json https://raw.githubusercontent.com/kangax/compat-table/gh-pages/data-common.json
curl -L -o data-es5.js https://raw.githubusercontent.com/kangax/compat-table/gh-pages/data-es5.js
curl -L -o data-es6.js https://raw.githubusercontent.com/kangax/compat-table/gh-pages/data-es6.js
curl -L -o data-es2016plus.js https://raw.githubusercontent.com/kangax/compat-table/gh-pages/data-es2016plus.js
curl -L -o data-esintl.js https://raw.githubusercontent.com/kangax/compat-table/gh-pages/data-esintl.js
curl -L -o data-esnext.js https://raw.githubusercontent.com/kangax/compat-table/gh-pages/data-esnext.js
Expand Down
88 changes: 81 additions & 7 deletions test/ecmascript/data-common.json
Original file line number Diff line number Diff line change
Expand Up @@ -49,13 +49,18 @@
"sharedmem": {
"val": "flagged",
"note_id": "firefox-sharedmem",
"note_html": "The feature have to be enabled via <code>javascript.options.shared_memory</code> setting under <code>about:config</code>. It is enabled by default in Firefox Developer Edition and Firefox Nightly builds."
"note_html": "The feature has to be enabled via <code>javascript.options.shared_memory</code> setting under <code>about:config</code>. It is enabled by default in Firefox Developer Edition and Firefox Nightly builds."
},
"nomob": {
"val": "flagged",
"note_id": "firefox-nomob",
"note_html": "The feature is available on desktop versions only, it is not available on mobile versions yet."
},
"beta": {
"val": "flagged",
"note_id": "firefox-beta",
"note_html": "The feature is available only in Firefox Beta, Firefox Developer Edition and Firefox Nightly builds."
},
"developer": {
"val": "flagged",
"note_id": "firefox-developer",
Expand All @@ -69,34 +74,39 @@
"bigint": {
"val": "flagged",
"note_id": "firefox-bigint",
"note_html": "The feature have to be enabled via <code>javascript.options.bigint</code> setting under <code>about:config</code>."
"note_html": "The feature has to be enabled via <code>javascript.options.bigint</code> setting under <code>about:config</code>."
},
"classFields": {
"val": "flagged",
"note_id": "firefox-class-fields",
"note_html": "The feature have to be enabled via <code>javascript.options.experimental.fields</code> setting under <code>about:config</code>."
"note_html": "The feature has to be enabled via <code>javascript.options.experimental.fields</code> setting under <code>about:config</code>."
},
"privateFields": {
"val": "flagged",
"note_id": "fx-private-fields",
"note_html": "The feature has to be enabled via <code>javascript.options.experimental.private_fields</code> setting under <code>about:config</code>."
},
"privateClassFields": {
"val": false,
"note_id": "firefox-private-class-fields",
"note_html": "The feature have to be enabled via <code>javascript.options.experimental.fields</code> setting under <code>about:config</code>. Private fields are supported by parser, but behave as public fields."
"note_html": "The feature has to be enabled via <code>javascript.options.experimental.fields</code> setting under <code>about:config</code>. Private fields are supported by parser, but behave as public fields."
}
},
"chrome": {
"sharedmem": {
"val": "flagged",
"note_id": "chrome-sharedmem",
"note_html": "The feature have to be enabled via \"Experimental enabled SharedArrayBuffer support in JavaScript.\" setting under <code>about:flags</code>"
"note_html": "The feature has to be enabled via \"Experimental enabled SharedArrayBuffer support in JavaScript.\" setting under <code>about:flags</code>"
},
"experimental": {
"val": "flagged",
"note_id": "chrome-experimental",
"note_html": "The feature have to be enabled via \"Experimental Javascript features\" setting under <code>about:flags</code>"
"note_html": "The feature has to be enabled via \"Experimental Javascript features\" setting under <code>about:flags</code>"
},
"harmony": {
"val": "flagged",
"note_id": "chrome-harmony",
"note_html": "The feature have to be enabled via <code>--js-flags=\"--harmony\"</code> flag"
"note_html": "The feature has to be enabled via <code>--js-flags=\"--harmony\"</code> flag"
},
"tco": {
"val": false,
Expand All @@ -112,6 +122,11 @@
"val": false,
"note_id": "chrome-simd",
"note_html": "The feature is considered unstable, but can be enabled via <code>--js-flags=\"--harmony-simd\"</code> flag"
},
"stringPrototypeReplaceAll": {
"val": "flagged",
"note_id": "chrome-string-prototype-replace-all",
"note_html": "The feature is considered unstable, but can be enabled via <code>--js-flags=\"--harmony-string-replaceall\"</code> flag"
}
},
"safari": {
Expand All @@ -121,6 +136,65 @@
"note_html": "Safari 12 caches TemplateStrings using a GC-able \"CodeBlock\". But TemplateStrings are supposed to always be identical! When the CodeBlock is reclaimed, the TemplateStrings' identity is broken. Thankfully, <code>[[Call]]</code> vs <code>[[Construct]]</code> generate different CodeBlocks, which exposes the <a href='https://bugs.webkit.org/show_bug.cgi?id=190756'>broken behavior.</a>"
}
},
"graalvm": {
"es2020flag": {
"val": "flagged",
"note_id": "graalvm-es2020",
"note_html": "The feature can be enabled via <code>--js.ecmascript-version=2020</code> flag"
},
"es2021flag": {
"val": "flagged",
"note_id": "graalvm-es2021",
"note_html": "The feature can be enabled via <code>--js.ecmascript-version=2021</code> flag"
},
"es2022flag": {
"val": "flagged",
"note_id": "graalvm-es2022",
"note_html": "The feature can be enabled via <code>--js.ecmascript-version=2022</code> flag"
}
},
"hermes": {
"xEs6PromiseFlag": {
"val": "flagged",
"note_id": "hermes-promise",
"note_html": "The feature can be enabled via <code>-Xes6-promise</code> flag"
},
"xEs6SymbolFlag": {
"val": "flagged",
"note_id": "hermes-symbol",
"note_html": "The feature can be enabled via <code>-Xes6-symbol</code> flag"
},
"xEs6ProxyFlag": {
"val": "flagged",
"note_id": "hermes-proxy",
"note_html": "The feature can be enabled via <code>-Xes6-proxy</code> flag"
},
"evalStrictMode": {
"val": false,
"note_id": "hermes-eval-strict-mode",
"note_html": "Hermes isn't supporting strict mode in eval, test result is unrepresentative. See <a href=\"https://github.com/facebook/hermes/issues/102#issuecomment-528489267\">this comment</a> for details"
},
"evalLexicalScopeFailed": {
"val": false,
"note_id": "hermes-eval-lexical-scope-failed",
"note_html": "Hermes isn't supporting lexical scope in eval"
},
"evalLexicalScopeSuccess": {
"val": true,
"note_id": "hermes-eval-lexical-scope-success",
"note_html": "Hermes isn't supporting lexical scope in eval, test result is unrepresentative"
},
"catchDestructuring": {
"val": false,
"note_id": "hermes-catch-destructuring",
"note_html": "Hermes isn't currently supporting destructuring in catch parameters"
},
"class": {
"val": false,
"note_id": "hermes-class",
"note_html": "Hermes isn't currently supporting classes apparently"
}
},
"sparseNote": {
"val": true,
"note_id": "sparse_arrays",
Expand Down
Loading

0 comments on commit f5ea13a

Please sign in to comment.