Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: node references #674

Merged
merged 31 commits into from
Dec 16, 2024
Merged

feat: node references #674

merged 31 commits into from
Dec 16, 2024

Conversation

crowlKats
Copy link
Member

No description provided.

src/parser.rs Outdated
Comment on lines 197 to 204
.elements
.iter()
.map(|node| Rc::unwrap_or_clone(node.clone()))
.collect::<Vec<_>>();

self.resolve_reference_for_nodes(specifier, &mut nodes)?;

namespace_def.elements = nodes.into_iter().map(Rc::new).collect();
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

wish this could be cleaned up/avoided

@crowlKats crowlKats marked this pull request as ready for review December 7, 2024 10:41
Copy link
Member

@dsherret dsherret left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks really good! Just have a few questions.

chat.ts Outdated Show resolved Hide resolved
namespace.ts Outdated Show resolved Hide resolved
src/html/mod.rs Outdated Show resolved Hide resolved
src/node.rs Show resolved Hide resolved
.iter()
.flat_map(|node| {
if let Some(namespace) = node.namespace_def() {
walk_rc_nodes(&namespace.elements)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is it possible for someone to create a circular reference by being stupid and cause an inifinte loop here?

src/parser.rs Outdated Show resolved Hide resolved
src/parser.rs Show resolved Hide resolved
src/parser.rs Show resolved Hide resolved
src/parser.rs Show resolved Hide resolved
src/parser.rs Outdated Show resolved Hide resolved
Copy link
Member

@dsherret dsherret left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. Nice work

@crowlKats crowlKats merged commit c5f9f15 into main Dec 16, 2024
5 checks passed
@crowlKats crowlKats deleted the node-references branch December 16, 2024 16:04
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