Skip to content

fix: Use resolve instead of evaluate#225

Merged
nicolo-ribaudo merged 3 commits intobabel:mainfrom
liuxingbaoyu:evaluate
Mar 2, 2025
Merged

fix: Use resolve instead of evaluate#225
nicolo-ribaudo merged 3 commits intobabel:mainfrom
liuxingbaoyu:evaluate

Conversation

@liuxingbaoyu
Copy link
Member

Currently relies on buggy behavior.
babel/babel#17156

Copy link
Member

@nicolo-ribaudo nicolo-ribaudo left a comment

Choose a reason for hiding this comment

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

Btw, could you change the comment in the Babel repo for resolve? The current one (Resolve a "pointer" NodePath to it's absolute path.) doesn't make much sense.

@nicolo-ribaudo nicolo-ribaudo merged commit d0285ee into babel:main Mar 2, 2025
7 checks passed
}
const resolved = path.resolve();
if (resolved.isIdentifier()) {
return resolved.node.name;
Copy link
Member Author

Choose a reason for hiding this comment

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

While working on #225 (review) I realized there is a observable difference.

var b = Math;
b.f16round();

Now it won't return Math, maybe I should open a PR to restore this behavior?

Copy link
Member

Choose a reason for hiding this comment

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

Yes, please!

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.

3 participants