konfigurator.audi.de - Site doesn't load due to errant "use strict", apparently from script concatenation

RESOLVED FIXED

Status

Tech Evangelism Graveyard
German
RESOLVED FIXED
8 years ago
3 years ago

People

(Reporter: Waldo, Unassigned)

Tracking

Details

(URL)

(Reporter)

Description

8 years ago
The URL should be a car-configuration widget sort of thing.  In actuality it mostly fails to load, because this script is in strict mode but contains a function statement not at top level of the entire script or of an individual function:

http://konfigurator.audi.de/v6-tpl-accx/js/all.vmjs?v=2011-02-02

The offending line in question is line 355, which has this in it:

css:function(a,b,d,f){if(b==="width"||b==="height"){var e,j=b==="width"?pb:qb;function i(){

The |function i| there starts a function statement which isn't a direct child of a function body or of the whole program, which in strict mode is a syntax error.  That prevents jQuery from loading, and probably other badness, and so the site fails completely.

Thanks go to Eddward for reporting this in bug 630851 comment 2.

Comment 1

8 years ago
This bug is also reported through input.mozilla.com
https://input.mozilla.com/en-US/beta/site/http/konfigurator.audi.de
(Reporter)

Comment 2

8 years ago
I tried writing something up in German to respond, but my German is too rusty to do it well.  It also doesn't help that I don't know the German technical terminology.  Could someone else give this a shot?  The contact form is here:

https://secure-www.audi.de/de/brand/de.html#source=https://secure-www.audi.de/de/brand/de/tools/navigation/audibar/contact.html&container=layerModal

As far as technical details to mention, point them to this bug by its URL, and point them to our strict mode documentation to explain the specific error they're hitting (specifically, it's the "Second, strict mode prohibits function statements not at the top level of a script or function." bit of the document):

https://developer.mozilla.org/en/JavaScript/Strict_mode

Also specifically point out the paragraph beginning "This syntax has a trap that has already bitten a major site:".  It looks like their problem might be script concatenation (beyond just the syntax mistake).  Regardless whether it is or isn't the root problem, they should remove the "use strict" from the first script in that concatenated sequence to fix their site.  Also note that the faulty script is:

http://konfigurator.audi.de/v6-tpl-accx/js/all.vmjs?v=2011-02-02

Note also that their code will soon fail in other browsers besides Firefox 4 (such as Safari), so it's important they fix their mistakes for more than just Firefox users.

Last, ask them if they added the "use strict" themselves, or if it was in the code to start.  If it was in to start, we'd like to know where they got that code, so we can tell the original authors that they probably shouldn't opt into strict mode prior to Firefox 4 (or another browser supporting ES5 strict mode) being shipped.

Comment 3

7 years ago
WFM!
Mozilla/5.0 (Windows NT 6.1; rv:2.2a1pre) Gecko/20110408 Firefox/4.2a1pre
Site has been revamped/maintained in the Meantime. Now it's fixed for me in 14/Nightly.
Status: NEW → RESOLVED
Last Resolved: 6 years ago
Resolution: --- → FIXED
Product: Tech Evangelism → Tech Evangelism Graveyard
You need to log in before you can comment on or make changes to this bug.