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

fix(compiler-core): properly rewrite identifier of for #8982

Closed
wants to merge 2 commits into from

Conversation

coderwei99
Copy link
Contributor

I think #7245 should take into account the case of for loop

example:

<div @click = "() => {
	for(let i = 0; i < 10; i++){
		console.log(i,arr[i])
	}
}"/>

i think the for loop should compiler to:

	for (let i = 0; i < 10; i++) {
            _ctx.log(i,_ctx.arr[i])
    }

but now it is:

	for (let i = 0; _ctx.i < 10; _ctx.i++) {
      _ctx.log(_ctx.i,_ctx.arr[_ctx.i])
  	}

@edison1105
Copy link
Member

I feel we should review the existing PR rather than open a new one.

@coderwei99
Copy link
Contributor Author

@edison1105 Can you tell me what should I do? thank!

@coderwei99 coderwei99 closed this Aug 18, 2023
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