Skip to content

[WebProfilerBundle] Fix infinite loop in JS #19803

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

Merged
merged 1 commit into from
Sep 1, 2016

Conversation

nicolas-grekas
Copy link
Member

Q A
Branch? master
Bug fix? yes (master only)
Tests pass? yes
License MIT

For some reason, I ended up having this while loop infinitely.

var toolbarBlocks = document.querySelectorAll('.sf-toolbar-block');
for (var i = 0; i < toolbarBlocks.length; i += 1) {
var toolbarBlocks = [].slice.call(document.querySelectorAll('.sf-toolbar-block'));
for (i in toolbarBlocks) {
Copy link
Contributor

Choose a reason for hiding this comment

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

I would leave the iteration with incrementor i. On some browsers it can iterate on some unexpected properties inherited from prototype

@romainneutron
Copy link
Contributor

👍 LGTM

@nicolas-grekas nicolas-grekas merged commit 68b6c32 into symfony:master Sep 1, 2016
nicolas-grekas added a commit that referenced this pull request Sep 1, 2016
This PR was merged into the 3.2-dev branch.

Discussion
----------

[WebProfilerBundle] Fix infinite loop in JS

| Q             | A
| ------------- | ---
| Branch?       | master
| Bug fix?      | yes (master only)
| Tests pass?   | yes
| License       | MIT

For some reason, I ended up having this while loop infinitely.

Commits
-------

68b6c32 [WebProfilerBundle] Fix infinite loop in JS
@nicolas-grekas nicolas-grekas deleted the profiler-fix branch September 1, 2016 10:01
@fabpot fabpot mentioned this pull request Oct 27, 2016
ostrolucky pushed a commit to ostrolucky/symfony that referenced this pull request Mar 25, 2018
…s-grekas)

This PR was merged into the 3.2-dev branch.

Discussion
----------

[WebProfilerBundle] Fix infinite loop in JS

| Q             | A
| ------------- | ---
| Branch?       | master
| Bug fix?      | yes (master only)
| Tests pass?   | yes
| License       | MIT

For some reason, I ended up having this while loop infinitely.

Commits
-------

68b6c32 [WebProfilerBundle] Fix infinite loop in JS
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants