Last modified: 2013-12-02 14:22:11 UTC

Wikimedia Bugzilla is closed!

Wikimedia migrated from Bugzilla to Phabricator. Bug reports are handled in Wikimedia Phabricator.
This static website is read-only and for historical purposes. It is not possible to log in and except for displaying bug reports and their history, links might be broken. See T59773, the corresponding Phabricator task for complete and up-to-date bug report information.
Bug 57773 - mw.Uri.test: Internet Explorer treats optional capturing groups not as undefined
mw.Uri.test: Internet Explorer treats optional capturing groups not as undefined
Status: NEW
Product: MediaWiki
Classification: Unclassified
Unit tests (Other open bugs)
1.23.0
All All
: Normal normal (vote)
: ---
Assigned To: Nobody - You can work on this!
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2013-11-30 16:56 UTC by Umherirrender
Modified: 2013-12-02 14:22 UTC (History)
3 users (show)

See Also:
Web browser: Internet Explorer
Mobile Platform: ---
Assignee Huggle Beta Tester: ---


Attachments

Description Umherirrender 2013-11-30 16:56:20 UTC
There is a mw.uri test which fails in Internet Explorer 8:

Testname: basic object properties
Expected:  {
  "fragment": undefined,
  "host": "www.ietf.org",
  "path": "/rfc/rfc2396.txt",
  "port": undefined,
  "protocol": "http",
  "query": {}
}
Result:  {
  "fragment": "",
  "host": "www.ietf.org",
  "path": "/rfc/rfc2396.txt",
  "port": "",
  "protocol": "http",
  "query": {}
}

Testname: Parse an ftp URI correctly with user and password
Expected:  {
  "fragment": undefined,
  "host": "192.0.2.16",
  "password": "pwd",
  "path": "/",
  "port": undefined,
  "protocol": "ftp",
  "query": {},
  "user": "usr"
}
Result:  {
  "fragment": "",
  "host": "192.0.2.16",
  "password": "pwd",
  "path": "/",
  "port": "",
  "protocol": "ftp",
  "query": {},
  "user": "usr"
} 

and some more (6 failures)


Looks like InternetExplorer init all capturing groups with a empty string and when the group not matched the empty string is the value.
Comment 1 Derk-Jan Hartman 2013-12-02 11:31:46 UTC
http://xregexp.com/cross_browser/#npcgUndefined

In Internet Explorer, captured values for nonparticipating capturing groups are incorrectly returned by RegExp.prototype.exec and String.prototype.match as an empty string rather than undefined, making it impossible to determine group participation. Firefox splices empty strings instead of undefined into the array returned by String.prototype.split as the result of nonparticipating capturing groups.

Note You need to log in before you can comment on or make changes to this bug.


Navigation
Links