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

support of using this in propertyassignment function #22

Merged
merged 1 commit into from
Oct 13, 2023

Conversation

WenLY1
Copy link
Contributor

@WenLY1 WenLY1 commented Oct 11, 2023

No description provided.

Copy link
Contributor

@yviansu yviansu left a comment

Choose a reason for hiding this comment

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

LGTM

src/scope.ts Outdated
@@ -1213,12 +1213,17 @@ export class ScopeScanner {
} else {
if (ts.isPropertyAssignment(node.parent)) {
functionName = node.parent.name.getText();
functionScope.envParamLen++;
Copy link
Contributor

Choose a reason for hiding this comment

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

This function _generateFuncScope is designed to generate default functions, whose envParamLen is 1, for object literal's functions, we regard it as class methods now, whose envParamLen is 2.

Would it be better that delete this if (ts.isPropertyAssignment(node.parent)) condition, but add this condition into here: https://github.com/intel/Wasmnizer-ts/blob/202df8b6e3d1ebdb66618211b70f25bfd5f80543/src/scope.ts#L967-L971
And if this condition is true, just invoke _generateClassFuncScope, and if false, invoke _generateFuncScope?

@xujuntwt95329 xujuntwt95329 merged commit 71482d1 into web-devkits:main Oct 13, 2023
4 checks passed
@WenLY1 WenLY1 deleted the dev_wly branch October 17, 2023 01:51
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