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

Resolve #406 - exit_binding_identifier now handles lazy functions #407

Merged
merged 1 commit into from
May 3, 2019

Conversation

Yoric
Copy link
Collaborator

@Yoric Yoric commented May 2, 2019

exit_binding_identifier contains a hard-coded list of nodes that represent
functions. This is hardly ideal (perhaps we should somehow put this in the webidl?)
and at some point, we failed to update this list, causing the bug.

@Yoric Yoric requested a review from arai-a May 2, 2019 12:46
fn exit_eager_function_declaration(
&mut self,
path: &WalkPath,
node: &mut EagerFunctionDeclaration,
) -> ExitResult<EagerFunctionDeclaration> {
debug!(target: "annotating", "exit_eager_function_declaration {:?} at {:?}", node.name.name, path);
self.exit_lazy_or_eager_function_declaration(path, &node.name)?;
Copy link
Member

@RReverser RReverser May 2, 2019

Choose a reason for hiding this comment

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

In all of these, it seems you could just write:

self.exit_lazy_or_eager_function_declaration(path, &node.name)

to return result immediately?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

The return type is different, unfortunately.

Copy link
Member

Choose a reason for hiding this comment

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

Ah. I guess you can make that function generic to return any ExitResult<T>?

@RReverser
Copy link
Member

Seems fine by me, but I'll better leave it to you and @arai-a :)

@RReverser
Copy link
Member

@Yoric Although, could you maybe change or re-enable tests responsible for lazification as part of this?

exit_binding_identifier contains a hard-coded list of nodes that represent
functions. This is hardly ideal (perhaps we should somehow put this in the webidl?)
and at some point, we failed to update this list, causing the bug.

Also:
- removing some dead code;
- making sure that test_roundtrip covers this case.
@Yoric Yoric force-pushed the entropy-0.4.1-annotations branch from 3ad82e7 to ea402a8 Compare May 3, 2019 14:53
@Yoric Yoric merged commit 9efd465 into binast:master May 3, 2019
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