File tree Expand file tree Collapse file tree
src/ast-analysis/visitors Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -269,6 +269,13 @@ export function createAstStoreVisitor(
269269 // unrelated subtree. The parent call's skipChildren handles the intended case.
270270 if ( matched . has ( node . id ) ) return ;
271271
272+ // Gate with `hasOwn` because plain-object lookup walks Object.prototype:
273+ // tree-sitter node types like `constructor` (Haskell sum-types: Left,
274+ // Right) would otherwise resolve to `Object.prototype.constructor` (the
275+ // Object() function), which then crashes the worker boundary with
276+ // "function Object() { [native code] } could not be cloned" when the
277+ // resulting astNodes row is structured-cloned back to the main thread.
278+ if ( ! Object . hasOwn ( astTypeMap , node . type ) ) return ;
272279 const kind = astTypeMap [ node . type ] ;
273280 if ( ! kind ) return ;
274281
Original file line number Diff line number Diff line change @@ -90,9 +90,14 @@ const SKIP_VERSIONS = new Set(['3.8.0']);
9090 * above the natural variance of the small target set. Not reproducible
9191 * locally (~30ms steady-state); will be re-validated on v3.9.7+ data.
9292 *
93- * - 3.9.6:resolution haskell precision/recall — separate Haskell resolver
94- * regression introduced in 3.9.6, unrelated to #1036 / PR #1038. Tracked
95- * in #1039.
93+ * - 3.9.6:resolution haskell precision/recall — Haskell AST visitor walked
94+ * `astTypeMap` with bracket-notation lookup, so node type `constructor`
95+ * (Haskell sum-types: Left, Right) resolved to `Object.prototype.constructor`
96+ * instead of `undefined`. The Object() function landed in the astNodes row
97+ * and crashed the worker boundary with "function Object() could not be
98+ * cloned", skipping every Haskell file with constructors. Fixed by gating
99+ * with `Object.hasOwn` (#1039). Benchmarks captured before the fix landed;
100+ * will reclear in v3.9.7+ data.
96101 */
97102const KNOWN_REGRESSIONS = new Set ( [
98103 '3.9.0:1-file rebuild' ,
You can’t perform that action at this time.
0 commit comments