Skip to content

Conversation

Copy link
Contributor

Copilot AI commented Nov 14, 2025

Replaces the custom DOM traversal implementation with JavaScript's built-in document.createTreeWalker() API.

Changes

node_traversor.js: Replaced manual node navigation with TreeWalker methods while preserving identical visitor pattern and traversal order.

// Before: Manual traversal
node = node.childNodes[0];
node = node.nextSibling;
node = node.parentNode;

// After: TreeWalker API
node = walker.firstChild();
node = walker.nextSibling();
node = walker.parentNode();

POM files: Fixed relativePath references in 5 pom.xml files to enable Maven resolution of parent artifact.

Compatibility

No changes required in consuming code (node_ext.js, __pulsar_utils__.js, feature_calculator.js). Visitor callbacks (head/tail) and depth tracking behavior unchanged.

Original prompt

目前,在注入的 javascript 脚本中,使用了自定义的 __pulsar_NodeTraversor,将其替换成 js 内置遍历器


💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.

Copilot AI changed the title [WIP] Replace custom __pulsar_NodeTraversor with built-in JavaScript traverser Replace custom __pulsar_NodeTraversor with native TreeWalker API Nov 14, 2025
Copilot AI requested a review from galaxyeye November 14, 2025 08:13
Copilot finished work on behalf of galaxyeye November 14, 2025 08:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants