[Prototype-core] Re: /script and ] in a regex confuses the Fox

2007-05-14 Thread Ryan Schuft

As a reference, the same fix that Christophe presented is shown near
the top of this page:  http://javascript.crockford.com/script.html

The quote from the page reads:  The script should not contain the
sequence / because it could be confused with the /script. Inserting
a backslash between  and / in strings avoids the problem. \/  The
backslash will be ignored by the JavaScript compiler. 

Is it acceptable to embed plain text closing tags into String and
RegExp objects as long as the script is not embedded inline?  I'm
making the assumption that the script functions in its existing form
only because the HTML parser isn't involved when you load the script
externally.  I would think it would be better form to use a non-
limiting syntax for the script even if the act of embedding the text
into a single document is unappealing and poses no immediately obvious
benefit beyond making it self contained.  It also isn't code that you
could reuse in an inline script if you wanted (as an arbitrary and not
entirely plausible example) to override a portion of the script inline
rather than altering the files themselves.  Out of curiosity, why
would the fix not go into the main distribution?

- Ryan Schuft


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
Prototype: Core group.
To post to this group, send email to prototype-core@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/prototype-core?hl=en
-~--~~~~--~~--~--~---



[Prototype-core] Re: /script and ] in a regex confuses the Fox

2007-05-14 Thread Mislav Marohnić
On 5/14/07, Ryan Schuft [EMAIL PROTECTED] wrote:


 Out of curiosity, why would the fix not go into the main distribution?


Embedding a 90+ KB (which is Prototype) in a document is insane. This
applies to online web pages, while for offline content it could make sense
in a scenario when you want a document to be self-contained, like you said.
With offline content (and sometimes company intranets) size doesn't really
matter.

I support making it inline-compatible if all it takes is a couple of
backslashes. However, we strongly advise W. Niu to change his CMS.

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
Prototype: Core group.
To post to this group, send email to prototype-core@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/prototype-core?hl=en
-~--~~~~--~~--~--~---