-
Notifications
You must be signed in to change notification settings - Fork 62
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
Conversation
src/parser.rs
Outdated
.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(); |
There was a problem hiding this comment.
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
There was a problem hiding this 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.
.iter() | ||
.flat_map(|node| { | ||
if let Some(namespace) = node.namespace_def() { | ||
walk_rc_nodes(&namespace.elements) |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM. Nice work
ced2e39
to
6465aa4
Compare
No description provided.