Page MenuHomePhabricator

Toolbar doesn't show up due to extra comma (syntax error in IE7)
Closed, ResolvedPublic

Description

Author: pir234

Description:
In the English Wikipedia, IE 9 in Document Mode IE7 reports "Expected identifier, string or number" error at the end of this code (where the extra comma is):

$('#wikieditor-toolbar-link-int-target-status').data('request',(new mw.Api()).get({action:'query',prop:'pageprops',titles:target,ppprop:'disambiguation',indexpageids:true,})

Here's the complete error message:
SCRIPT1028: Expected identifier, string or number
load.php?debug=false&lang=en&modules=ext.wikiEditor%7Cext.wikiEditor.dialogs%2Ctoolbar%7Cext.wikiEditor.toolbar.hideSig%7Cjquery.wikiEditor%7Cjquery.wikiEditor.dialogs%2Ctoolbar%7Cjquery.wikiEditor.dialogs.config%7Cjquery.wikiEditor.toolbar.config%2Ci18n&skin=vector&version=20130803T022159Z&*, line 62 character 611


Version: unspecified
Severity: major

Details

Reference
bz52715

Event Timeline

bzimport raised the priority of this task from to Medium.Nov 22 2014, 2:05 AM
bzimport set Reference to bz52715.

Which problem does this create?
What are steps to reproduce this?

pir234 wrote:

The problem that it creates is that the toolbar doesn't show up and there is an error message, which shouldn't happen if it can be avoided. Note that extra commas are well known to cause errors in older versions of IE. It's a well known IE bug.

Steps to recreate: open IE9, in your Preferences in Wikipedia select "Enable enhanced editing toolbar". Press F12 to open the developer tools, now open an article and edit it. On top of Developer Tools you will see: "Browser Mode: IE 9 Compat View Document Mode: IE(?) standards", where (?) is "7" on the computers I tested, if it's not on yours, click on Document Mode and select "Document Mode: IE7 standards" from the drop-down menu - the page will be reloaded and there will be no toolbar above the textarea and you will see the error message "Expected identifier, string or number" in Developer tools. To see the error message you must click on the Console tab of Developer Tools. Now if you click on the link below the error message it will show you the point in the code that causes the error.

Change 80556 had a related patch set uploaded by Umherirrender:
Remove extra comma to avoid fatal in IE7

https://gerrit.wikimedia.org/r/80556

Change 80556 merged by jenkins-bot:
Remove extra comma to avoid fatal in IE7

https://gerrit.wikimedia.org/r/80556

One more argument that proves we really need to fix the remaining jslint issues on those files, so that we can make problems like this fatal in jenkins....

Approve backporting this to wmf13 and wmf14 and pushing out.

CC'ing Reedy to see if he could get this on his list soon.