Closed
Bug 987889
Opened 10 years ago
Closed 10 years ago
Initialiser expression in the for(in) statement on bf4 site
Categories
(Web Compatibility :: Site Reports, defect)
Tracking
(Not tracked)
RESOLVED
FIXED
People
(Reporter: miketaylr, Unassigned)
References
()
Details
From es-discuss:
On 3/14/14, 15:53, Brendan Eich wrote:> Andreas Rossberg wrote:
>> On 14 March 2014 00:59, Oliver Hunt<oliver@apple.com> wrote:
>>> > JSC has been trying to kill off the initialiser expression in the for(in)
>>> > statement, but we've encountered a bunch of reasonably significant content
>>> > that breaks with it disallowed (a particularly prominent one currently is
>>> > http://battlelog.battlefield.com/bf4/), so we will be bringing back support
>>> > for
>>> >
>>> > for (var Identifier = Expression in Expression)
>>
>> I'd be curious to know what the actual code is, and to get an idea why
>> they are using it that way.
>
> http://battlelog.battlefield.com/bf4/
> for (var i = 0 in debug.audio)
>
> I say we should evangelize this site. Cc'ing some awesome Mozilla site
> evangelists.
Reporter | ||
Comment 1•10 years ago
|
||
http://eaassets-a.akamaihd.net/bl-cdn/cdnprefix/B3e85add4d509011e5347bc29966cba2fa6ced6ae/public/generated/en_US/bundle_base_bottombundles_2189137393.js for(var i=0 in debug.audio){var elem=debug.audio[audioLength-i-1];
Reporter | ||
Comment 2•10 years ago
|
||
Adam, do you think you could help us find a contact here?
Reporter | ||
Comment 3•10 years ago
|
||
suggestedfix |
So the suggested fix is simple here, just use a regular for loop: for (var i = 0; i < audioLength; i++) { var elem = debug.audio[audioLength-i-1]; ... }
Reporter | ||
Comment 4•10 years ago
|
||
So it turns out an irc buddy (Markus) can likely help us out on this. CCing him. (small world and all that)
Comment 5•10 years ago
|
||
Ugh, that's some ugly code! Fix committed :)
Reporter | ||
Comment 6•10 years ago
|
||
Thanks so much!
Reporter | ||
Comment 7•10 years ago
|
||
Code is no longer on the site. Thanks again Marcus.
Status: NEW → RESOLVED
Closed: 10 years ago
Resolution: --- → FIXED
Assignee | ||
Updated•5 years ago
|
Product: Tech Evangelism → Web Compatibility
You need to log in
before you can comment on or make changes to this bug.
Description
•