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): throw an error if variable with the same name is already defined. #7209

Merged
merged 5 commits into from May 26, 2016

Conversation

Ne4istb
Copy link
Contributor

@Ne4istb Ne4istb commented Feb 20, 2016

No description provided.

@zoechi
Copy link
Contributor

zoechi commented Mar 8, 2016

Does this also throw when the variable is added multiple times like

<div *ngFor="#item of items" #somevar></div>

This is sometimes handy and didn't cause issues for me so far.

@Ne4istb
Copy link
Contributor Author

Ne4istb commented Mar 9, 2016

@zoechi This change will not influence your case because it checks duplicates on template level, and ngFor creates separate templates. I've checked it locally :)

@zoechi
Copy link
Contributor

zoechi commented Mar 9, 2016

@Ne4istb great, thanks for the feedback :)

@mhevery
Copy link
Contributor

mhevery commented May 24, 2016

I am sorry for the delay in getting back to you.

Please add one more tests, which says that the same variables across different templates are OK.

<div #a>
  <span *ngIf="..." #a>OK</span>
</div>

The above is allowed.

@Ne4istb
Copy link
Contributor Author

Ne4istb commented May 24, 2016

Will do soon

@tbosch tbosch added the action: cleanup The PR is in need of cleanup, either due to needing a rebase or in response to comments from reviews label May 26, 2016
@Ne4istb
Copy link
Contributor Author

Ne4istb commented May 26, 2016

@tbosch What kind of cleanup should be done?
P.S. presubmit.sh does not work now, i guess, because of changes in gulpfile.js. How can I run any code style validation?

@tbosch
Copy link
Contributor

tbosch commented May 26, 2016

The test that @mhevery mentioned...

@tbosch
Copy link
Contributor

tbosch commented May 26, 2016

Try to rebase, master should be good again.

@Ne4istb
Copy link
Contributor Author

Ne4istb commented May 26, 2016

@tbosch
test is already there with template

<div #a><template #a><span>OK</span></template></div>

@mhevery mhevery merged commit 9036f78 into angular:master May 26, 2016
KiaraGrouwstra pushed a commit to KiaraGrouwstra/angular that referenced this pull request Jun 21, 2016
…dy defined. (angular#7209)

* fix(compiler): throw an error if variable with the same name is already defined. Closes angular#6492

* fix(compiler): Clean up formatting for issue angular#6492

* fix(compiler): throw an error if reference with the same name is already defined.

Closes angular#6492
@angular-automatic-lock-bot
Copy link

This issue has been automatically locked due to inactivity.
Please file a new issue if you are encountering a similar or related problem.

Read more about our automatic conversation locking policy.

This action has been performed automatically by a bot.

@angular-automatic-lock-bot angular-automatic-lock-bot bot locked and limited conversation to collaborators Sep 8, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
action: cleanup The PR is in need of cleanup, either due to needing a rebase or in response to comments from reviews cla: yes
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

6 participants