mirror of
https://github.com/storytold/vectorcraft.git
synced 2026-11-28 09:21:55 +01:00
JavaScript: the test262 runner screens for-of and pattern tests with the ES2015 lexer
run_tagged_tests skipped a test when its source did not tokenize with the default options, and the tokenizer parses the program, so every Symbol, for-of and destructuring test that used an ES2015 form was counted as skipped. It now tokenizes with the options the test runs with, as the ES2015 subset runner does. docs/mcp.md also lists every case in which an iterator is not closed: next() throws or gives a non-object, reading done or value throws, or the result says it is done.
This commit is contained in:
1 parent
04557f4893
commit
0d9ae86f12
2 files changed
+5
-4
No files matched your search
@@ -42,7 +42,7 @@
|
||||
//! Another test runs the tests of `Symbol`, `Object.getOwnPropertySymbols` and the iterators of
|
||||
//! arrays and strings (the folders [`SYMBOL_BUILT_INS`] names) in a realm with
|
||||
//! [`Options::es2015`]: tests of any edition whose feature tags are all in [`SYMBOL_FEATURES`] and
|
||||
//! that parse as ES5. Its failures go to `symbol-failures.txt`.
|
||||
//! that parse with that option. Its failures go to `symbol-failures.txt`.
|
||||
//!
|
||||
//! The last test reads the tests of `for-of` and destructuring (the folders
|
||||
//! [`FOR_OF_AND_PATTERN_FOLDERS`] names) with [`Options::es2015`]: tests of any edition whose
|
||||
@@ -1043,7 +1043,7 @@ fn run_tagged_tests(dir: &Path, root: &Path, missing: &HashSet<&str>, options: &
|
||||
}
|
||||
let tagged_elsewhere = meta.features.iter().any(|f| !features.contains(&f.as_str()));
|
||||
let includes: String = meta.includes.iter().map(|i| harness(i) + "\n").collect();
|
||||
if tagged_elsewhere || meta.flags.iter().any(|f| f == "async") || needs_missing_builtin(&[&source, &includes], missing) {
|
||||
if tagged_elsewhere || meta.flags.iter().any(|f| f == "async") || needs_missing_builtin_in(&[&source, &includes], missing, options) {
|
||||
counts.skipped += 1;
|
||||
continue;
|
||||
}
|
||||
|
||||
+3
-2
@@ -2624,8 +2624,9 @@ parameters, spread in array literals, calls and `new`, `for`-`of` loops, array a
|
||||
`let` and `const` declarations, assignments, parameters and `catch` clauses (with defaults, holes and rest elements),
|
||||
and shorthand and computed property names in object literals (https://262.ecma-international.org/11.0/). Spread,
|
||||
`for`-`of` and array patterns use the iterator protocol. A loop or pattern left early, by `break`, `return`, a
|
||||
`continue` to an outer loop or an exception, calls the iterator's `return` method when it has one; an iterator whose
|
||||
`next()` throws or says it is done is not closed. Destructuring `undefined` or `null` throws a `TypeError`. Object rest properties
|
||||
`continue` to an outer loop or an exception, calls the iterator's `return` method when it has one. An iterator is not
|
||||
closed when its `next()` throws or gives a result that is not an object, when reading the result's `done` or `value`
|
||||
throws, or when the result says it is done. Destructuring `undefined` or `null` throws a `TypeError`. Object rest properties
|
||||
(`{ a, ...rest }`, ECMAScript 2018) are syntax errors. In an engine that `#targetengine` keeps and a `.jsx` script
|
||||
started, which has no `Symbol`, spread, `for`-`of` and array patterns read arrays, `arguments` objects and strings
|
||||
(by code point), by index, and throw a `TypeError` for any other value; that rule is VectorCraft's own. `eval`, `Function`, `#include` files and `$.evalFile` read code the way the script does, and
|
||||
|
||||
Reference in new issue
Block a user