[Laszlo-dev] Funny bugs in flash.js and embednew.js
Max Carlson
max at openlaszlo.org
Wed Nov 29 11:00:24 PST 2006
P T Withington wrote:
> I was playing around with trying to use our compiler to do compression
> and due to a bug in our compiler, I think I have found a bug in both
> flash.js and embednew.js.
Cool! It'll be great to have compression an automated part of the build...
In flash.js, I'm not sure what the intent of
> this line is:
>
>> document.writeln('<script language="VBScript"
>> type="text/vbscript"\>');
>
> What is intended with `\>`? Since > is not a 'single escape char', the
> `\` essentially has no effect. If the intent is that the writeline
> should actually insert `\>` into the document, then you would need to
> say `\\>`, to get a literal `\` into the string.
I'm sure it's an extra escape for the > character. Inherited from
dojo.flash and harmless IMHO.
> In embednew.js there is this string:
>
>> var re = new RegExp("MSIE ([0-9]{1,}[\.0-9]{0,})");
>
> I suspect the `\.` is meant to escape the `.` to make it a literal, but
> again you would need to double the `\`s to get that effect. As it
> stands, this regexp will match one or more digits followed by any number
> of other characters. Even if you fix that, this regexp looks like it is
> asking for failure. It will then match numbers of the form nnn.nnn.nnn,
> which will not parse as a float. If the intent is to parse only the
> first two version numbers, why not use `\\d+\\.\\d+` as is done for the
> other browsers? If there is actually a possibility that there will be
> no minor component, we could use `\\d+(?:\\.\\d+)?`.
Sounds good to me. Svn blame pegs you as the author, so please fix it!
-Max
More information about the Laszlo-dev
mailing list