From 0d9ae86f124edde4ac33b840120e752d7bbe9af6 Mon Sep 17 00:00:00 2001 From: dotCooCoo Date: Sun, 22 Nov 2026 12:52:52 -0800 Subject: [PATCH] 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. --- crates/js/tests/test262.rs | 4 ++-- docs/mcp.md | 5 +++-- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/crates/js/tests/test262.rs b/crates/js/tests/test262.rs index 972a3075e5..9e21c88a65 100644 --- a/crates/js/tests/test262.rs +++ b/crates/js/tests/test262.rs @@ -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; } diff --git a/docs/mcp.md b/docs/mcp.md index 6205b13fad..f27e407706 100644 --- a/docs/mcp.md +++ b/docs/mcp.md @@ -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