In chrome, I get weird JS errors in the console, which are useless because of #1639012: Guard against broken behaviors.
Reverting that patch, I see errors since a variable is undefined?!

But fixing that doesn't solve the problem.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

tim.plunkett’s picture

Status: Active » Needs review
FileSize
1 KB

I can't believe this is causing JS errors.

tim.plunkett’s picture

Issue tags: +VDC

tagging

dawehner’s picture

Issue tags: +Needs JavaScript review
FileSize
972 bytes

To meet the coding style of the other parts, this seems to fit better.

nod_’s picture

nod_’s picture

The undefined thing is causing errors because of "use strict"; it will error out if there are implicit global variables declared, like here.

dawehner’s picture

@nod_

Which of the two approaches is the way to go forward on this issue?

nod_’s picture

for the sake of consistency it should be #1 although I agree that ideally #3 would be the prefered format.

so I'd say #1 and if we get around fixing the declaration it should be for all of core js.

nod_’s picture

tags

dawehner’s picture

Well, there are more then just two different for loops in this file so 1) might actually be less consistent.

nod_’s picture

oh that's true, I was looking at the rest of core but in this file it's different. Views js needs love anyway so either works, I don't mind.

dawehner’s picture

Status: Needs review » Reviewed & tested by the community

To be honest, personally I really prefer the #1 style, as it's more consistent with the rest of Drupal core, so basically let's do that.

catch’s picture

Status: Reviewed & tested by the community » Needs review

Hmm I like #3 better :P

Is the issue to consolidate this open already? I'll commit whichever patch once it is.

dawehner’s picture

I guess we simply can't decide it: Either throw a coin or just use #3 as you liked it better :)

dawehner’s picture

Status: Needs review » Reviewed & tested by the community

So #3 is better :)

webchick’s picture

Status: Reviewed & tested by the community » Fixed

Committed and pushed to 8.x. Thanks!

Automatically closed -- issue fixed for 2 weeks with no activity.