+
Skip to content
This repository was archived by the owner on Aug 31, 2023. It is now read-only.

fix(rome_js_semantic): bug when hoisting function scope #2940

Merged
merged 11 commits into from
Jul 28, 2022

Conversation

xunilrj
Copy link
Contributor

@xunilrj xunilrj commented Jul 27, 2022

Summary

Creates the distinction between "scope" and "scope_hoisted_to" for declarations that are hoisted. This gives more information on where to look at conflicts when renaming symbols.

And fix a bug when renaming functions.
Will enable #2926 to be merged.

Test Plan

> cargo test -p rome_js_semantic -- ok_function
> cargo test -p rome_js_analyze -- rename

@xunilrj xunilrj temporarily deployed to aws July 27, 2022 15:14 Inactive
@xunilrj
Copy link
Contributor Author

xunilrj commented Jul 27, 2022

This PR solves a bug when renaming functions and will impact #2835.
Now correct block function renaming when there are conflicts.

@github-actions
Copy link

github-actions bot commented Jul 27, 2022

@cloudflare-workers-and-pages
Copy link

cloudflare-workers-and-pages bot commented Jul 27, 2022

Deploying with  Cloudflare Pages  Cloudflare Pages

Latest commit: 4042fab
Status: ✅  Deploy successful!
Preview URL: https://a56d66d7.tools-8rn.pages.dev
Branch Preview URL: https://fix-hoisting-scope.tools-8rn.pages.dev

View logs

@xunilrj xunilrj temporarily deployed to aws July 28, 2022 06:05 Inactive
@xunilrj xunilrj temporarily deployed to aws July 28, 2022 06:06 Inactive
@xunilrj xunilrj temporarily deployed to aws July 28, 2022 06:06 Inactive
@xunilrj xunilrj temporarily deployed to aws July 28, 2022 06:18 Inactive
@xunilrj xunilrj temporarily deployed to aws July 28, 2022 06:20 Inactive
@xunilrj xunilrj temporarily deployed to aws July 28, 2022 06:22 Inactive
@xunilrj xunilrj temporarily deployed to aws July 28, 2022 06:24 Inactive
@xunilrj xunilrj temporarily deployed to aws July 28, 2022 06:25 Inactive
@xunilrj xunilrj marked this pull request as ready for review July 28, 2022 06:26
@xunilrj xunilrj requested a review from leops as a code owner July 28, 2022 06:26
@ematipico
Copy link
Contributor

Will impact #2835

Could you please update the issue and leave a note of how this PR will impact the release?

@@ -396,7 +400,15 @@ impl SemanticModel {
}
}

/// Return the [Scope] which the syntax is part of.
/// Returns the global scope of the model
pub fn global_scope(&self) -> Scope {
Copy link
Contributor

Choose a reason for hiding this comment

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

You finally created it! 😝

@xunilrj xunilrj merged commit 373b6c4 into main Jul 28, 2022
@xunilrj xunilrj deleted the fix/hoisting-scope branch July 28, 2022 10:05
IWANABETHATGUY pushed a commit to IWANABETHATGUY/tools that referenced this pull request Aug 22, 2022
* fix hoisting scope when building semantic model
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants
点击 这是indexloc提供的php浏览器服务,不要输入任何密码和下载