Frontmatter
| id | 8816 |
| title | Fix Prototype Pollution in Unit Tests by Assigning Neo.setupClass |
| state | Closed |
| labels | bugtestingcore |
| assignees | tobiu |
| createdAt | Jan 19, 2026, 6:29 PM |
| updatedAt | Jan 19, 2026, 6:30 PM |
| githubUrl | https://github.com/neomjs/neo/issues/8816 |
| author | tobiu |
| commentsCount | 1 |
| parentIssue | null |
| subIssues | [] |
| subIssuesCompleted | 0 |
| subIssuesTotal | 0 |
| blockedBy | [] |
| blocking | [] |
| closedAt | Jan 19, 2026, 6:30 PM |
Fix Prototype Pollution in Unit Tests by Assigning Neo.setupClass
tobiu assigned to @tobiu on Jan 19, 2026, 6:30 PM

tobiu
Jan 19, 2026, 6:30 PM
Input from Gemini 3 Pro:
✦ I have applied the
Class = Neo.setupClass(Class)pattern to all unit tests that were missing it. This ensures that the class system works correctly and prevents prototype pollution that was causing instability and cross-test contamination. Files updated:
test/playwright/unit/core/ClassConfigsAndFields.spec.mjstest/playwright/unit/neo/MixinStaticConfig.spec.mjstest/playwright/unit/state/Provider.spec.mjstest/playwright/unit/vdom/AutoId.spec.mjsThis should resolve the
TypeError: Neo.setupClass is not a functionerrors seen in CI.
tobiu closed this issue on Jan 19, 2026, 6:30 PM
Multiple unit tests were calling
Neo.setupClass(Class)without assigning the result back to the class variable. This causes prototype pollution because the original class constructor is modified in place (or its prototype is), but the enhanced class (returned bysetupClass) is not used. This leads to unpredictable test interactions and failures, particularlyTypeError: Neo.setupClass is not a functionwhen subsequent tests rely on a clean state or when the class system enhancement logic is bypassed.This fix applies the pattern
Class = Neo.setupClass(Class)to all affected unit tests.