Closed Bug 101070 Opened 19 years ago Closed 18 years ago

microsoft.com - Using "/" character unescaped in RegExp literals is non-ECMA

Categories

(Tech Evangelism Graveyard :: English US, defect, P1, major)

x86
All

Tracking

(Not tracked)

RESOLVED FIXED

People

(Reporter: pschwartau, Assigned: bc)

References

()

Details

This was discovered in:

                              bug 98306
                              bug 99377
                              bug 99667


At the webpages given in these bugs, all at http://msdn.microsoft.com/, 
syntax like this is used:


this.userAgent.match(/Mozilla[/].*(95[/]NT|95|NT|98|3.1).*Opera.*(\d+)\.(\d+)/)



Notice the use of the character "/" in the RegExp literal. According 
to the ECMA-262 Final spec, the character "/" must be ESCAPED by "\"
if used inside a RegExp literal. It can only be unescaped if passed to
the RegExp() function or constructor. See bug 98306 for documentation.


This incorrect syntax causes Mozilla to report a JS syntax error
every time such code is encountered at http://msdn.microsoft.com
Raising severity to major because of the importance of this site.
Note the fix is easy to implement -
Severity: normal → major
Priority: -- → P1
Summary: Using "/" character unescaped in RegExp literals is non-ECMA → microsoft.com - Using "/" character unescaped in RegExp literals is non-ECMA
I can't reproduce this.  Some of the MSDN pages load fine for me, while some
don't show up at all.  What is the exact URL of the MSDN web page script that
contains the [/]'s, and what page directly calls that script?
The URL for the JS that contains the [/] subpattern is 
http://msdn.microsoft.com/workshop/code/browdata.js

It is included in many (most?) pages on that site, for example, the frameset:
http://msdn.microsoft.com/library/default.asp?url=/workshop/author/dhtml/refere
nce/dhtmlrefs.asp
in a child frame of that frameset:
http://msdn.microsoft.com/workshop/author/dhtml/reference/dhtmlrefs.asp?frame=t
rue

(Although, frankly, this bug seems somewhat quixotic to me :-]





Blocks: MS
contacted 12/8
Status: NEW → ASSIGNED
Target Milestone: --- → Jan
Whiteboard: [aok]
Keywords: evang500
Whiteboard: [aok]
I am not getting errors although the code doesn't seem to have changed.
did not see the error in:

http://msdn.microsoft.com/library/toolbar/toolbar.js
http://msdn.microsoft.com/library/toolbar/en-us/global.js
http://msdn.microsoft.com/library/include/ctredir.js

-> fixed.

Status: ASSIGNED → RESOLVED
Closed: 18 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.