You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@wicket.apache.org by "Peter Ertl (JIRA)" <ji...@apache.org> on 2007/04/25 19:42:15 UTC
[jira] Created: (WICKET-501) javascript comment stripping is
erroneous
javascript comment stripping is erroneous
-----------------------------------------
Key: WICKET-501
URL: https://issues.apache.org/jira/browse/WICKET-501
Project: Wicket
Issue Type: Bug
Components: wicket
Reporter: Peter Ertl
Priority: Critical
The following line is crippled when using javascript comment stripping
(from jquery.js)
// Handle the common XPath // expression
if ( !t.indexOf("//") ) {
it will be result in
if ( !t.indexOf("
the // inside the string quotes are taken as a comment instead of as a string...
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Updated: (WICKET-501) JavaScript comment stripping doesn't
handle // inside String literals.
Posted by "Alastair Maw (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/WICKET-501?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Alastair Maw updated WICKET-501:
--------------------------------
Assignee: Alastair Maw (was: Jean-Baptiste Quenot)
Affects Version/s: 1.3.0-beta1
> JavaScript comment stripping doesn't handle // inside String literals.
> -----------------------------------------------------------------------
>
> Key: WICKET-501
> URL: https://issues.apache.org/jira/browse/WICKET-501
> Project: Wicket
> Issue Type: Bug
> Components: wicket
> Affects Versions: 1.3.0-beta1
> Reporter: Peter Ertl
> Assignee: Alastair Maw
> Priority: Critical
> Fix For: 1.3.0-beta2
>
> Attachments: 20070425-WICKET-501-JavascriptStripper.txt, jquery-06-19-07-stripped.js, jquery-06-19-07.js
>
>
> The following line is crippled when using javascript comment stripping
> (from jquery.js)
> // Handle the common XPath // expression
> if ( !t.indexOf("//") ) {
> it will be result in
> if ( !t.indexOf("
> the // inside the string quotes are taken as a comment instead of as a string...
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Updated: (WICKET-501) javascript comment stripping is
erroneous
Posted by "Peter Ertl (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/WICKET-501?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Peter Ertl updated WICKET-501:
------------------------------
Attachment: jquery-06-19-07.js
the input file before being stripped / compressed
> javascript comment stripping is erroneous
> -----------------------------------------
>
> Key: WICKET-501
> URL: https://issues.apache.org/jira/browse/WICKET-501
> Project: Wicket
> Issue Type: Bug
> Components: wicket
> Reporter: Peter Ertl
> Assignee: Jean-Baptiste Quenot
> Priority: Critical
> Fix For: 1.3.0-beta2
>
> Attachments: 20070425-WICKET-501-JavascriptStripper.txt, jquery-06-19-07.js
>
>
> The following line is crippled when using javascript comment stripping
> (from jquery.js)
> // Handle the common XPath // expression
> if ( !t.indexOf("//") ) {
> it will be result in
> if ( !t.indexOf("
> the // inside the string quotes are taken as a comment instead of as a string...
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Reopened: (WICKET-501) javascript comment stripping is
erroneous
Posted by "Peter Ertl (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/WICKET-501?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Peter Ertl reopened WICKET-501:
-------------------------------
Sorry, but this issue seems to not be fixed 100%...
I get this error message in Firefox
>> unterminated string literal --- in jquery.js (line 707)
if ( !t.indexOf("\n
I attached the input file (it's jquery.js) and the corresponding output (jquery-stripped.js)
> javascript comment stripping is erroneous
> -----------------------------------------
>
> Key: WICKET-501
> URL: https://issues.apache.org/jira/browse/WICKET-501
> Project: Wicket
> Issue Type: Bug
> Components: wicket
> Reporter: Peter Ertl
> Assignee: Jean-Baptiste Quenot
> Priority: Critical
> Fix For: 1.3.0-beta2
>
> Attachments: 20070425-WICKET-501-JavascriptStripper.txt, jquery.js
>
>
> The following line is crippled when using javascript comment stripping
> (from jquery.js)
> // Handle the common XPath // expression
> if ( !t.indexOf("//") ) {
> it will be result in
> if ( !t.indexOf("
> the // inside the string quotes are taken as a comment instead of as a string...
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Commented: (WICKET-501) javascript comment stripping is
erroneous
Posted by "Jean-Baptiste Quenot (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/WICKET-501?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12491842 ]
Jean-Baptiste Quenot commented on WICKET-501:
---------------------------------------------
Actually yes, it works, see the attached unit test
> javascript comment stripping is erroneous
> -----------------------------------------
>
> Key: WICKET-501
> URL: https://issues.apache.org/jira/browse/WICKET-501
> Project: Wicket
> Issue Type: Bug
> Components: wicket
> Reporter: Peter Ertl
> Assigned To: Jean-Baptiste Quenot
> Priority: Critical
> Attachments: 20070425-WICKET-501-JavascriptStripper.txt
>
>
> The following line is crippled when using javascript comment stripping
> (from jquery.js)
> // Handle the common XPath // expression
> if ( !t.indexOf("//") ) {
> it will be result in
> if ( !t.indexOf("
> the // inside the string quotes are taken as a comment instead of as a string...
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Resolved: (WICKET-501) javascript comment stripping is
erroneous
Posted by "Jean-Baptiste Quenot (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/WICKET-501?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Jean-Baptiste Quenot resolved WICKET-501.
-----------------------------------------
Resolution: Fixed
Fix Version/s: 1.3
Fixed, thanks for reporting. If another issue comes up, please reopen this issue.
> javascript comment stripping is erroneous
> -----------------------------------------
>
> Key: WICKET-501
> URL: https://issues.apache.org/jira/browse/WICKET-501
> Project: Wicket
> Issue Type: Bug
> Components: wicket
> Reporter: Peter Ertl
> Assigned To: Jean-Baptiste Quenot
> Priority: Critical
> Fix For: 1.3
>
> Attachments: 20070425-WICKET-501-JavascriptStripper.txt, jquery.js
>
>
> The following line is crippled when using javascript comment stripping
> (from jquery.js)
> // Handle the common XPath // expression
> if ( !t.indexOf("//") ) {
> it will be result in
> if ( !t.indexOf("
> the // inside the string quotes are taken as a comment instead of as a string...
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Resolved: (WICKET-501) JavaScript comment stripping doesn't
handle regexps
Posted by "Alastair Maw (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/WICKET-501?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Alastair Maw resolved WICKET-501.
---------------------------------
Resolution: Fixed
Fixed in r548773.
> JavaScript comment stripping doesn't handle regexps
> ---------------------------------------------------
>
> Key: WICKET-501
> URL: https://issues.apache.org/jira/browse/WICKET-501
> Project: Wicket
> Issue Type: Bug
> Components: wicket
> Affects Versions: 1.3.0-beta1
> Reporter: Peter Ertl
> Assignee: Alastair Maw
> Priority: Critical
> Fix For: 1.3.0-beta2
>
> Attachments: 20070425-WICKET-501-JavascriptStripper.txt, jquery-06-19-07-stripped.js, jquery-06-19-07.js
>
>
> The following line is crippled when using javascript comment stripping
> (from jquery.js)
> // Handle the common XPath // expression
> if ( !t.indexOf("//") ) {
> it will be result in
> if ( !t.indexOf("
> the // inside the string quotes are taken as a comment instead of as a string...
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Issue Comment Edited: (WICKET-501) javascript comment
stripping is erroneous
Posted by "Peter Ertl (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/WICKET-501?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12506202 ]
Peter Ertl edited comment on WICKET-501 at 6/19/07 8:25 AM:
------------------------------------------------------------
upload: the input file before being stripped / compressed
was:
the input file before being stripped / compressed
> javascript comment stripping is erroneous
> -----------------------------------------
>
> Key: WICKET-501
> URL: https://issues.apache.org/jira/browse/WICKET-501
> Project: Wicket
> Issue Type: Bug
> Components: wicket
> Reporter: Peter Ertl
> Assignee: Jean-Baptiste Quenot
> Priority: Critical
> Fix For: 1.3.0-beta2
>
> Attachments: 20070425-WICKET-501-JavascriptStripper.txt, jquery-06-19-07-stripped.js, jquery-06-19-07.js
>
>
> The following line is crippled when using javascript comment stripping
> (from jquery.js)
> // Handle the common XPath // expression
> if ( !t.indexOf("//") ) {
> it will be result in
> if ( !t.indexOf("
> the // inside the string quotes are taken as a comment instead of as a string...
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Updated: (WICKET-501) javascript comment stripping is
erroneous
Posted by "Jean-Baptiste Quenot (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/WICKET-501?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Jean-Baptiste Quenot updated WICKET-501:
----------------------------------------
Fix Version/s: (was: trunk)
1.3.0-beta2
> javascript comment stripping is erroneous
> -----------------------------------------
>
> Key: WICKET-501
> URL: https://issues.apache.org/jira/browse/WICKET-501
> Project: Wicket
> Issue Type: Bug
> Components: wicket
> Reporter: Peter Ertl
> Assignee: Jean-Baptiste Quenot
> Priority: Critical
> Fix For: 1.3.0-beta2
>
> Attachments: 20070425-WICKET-501-JavascriptStripper.txt, jquery.js
>
>
> The following line is crippled when using javascript comment stripping
> (from jquery.js)
> // Handle the common XPath // expression
> if ( !t.indexOf("//") ) {
> it will be result in
> if ( !t.indexOf("
> the // inside the string quotes are taken as a comment instead of as a string...
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Commented: (WICKET-501) javascript comment stripping is
erroneous
Posted by "Igor Vaynberg (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/WICKET-501?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12491803 ]
Igor Vaynberg commented on WICKET-501:
--------------------------------------
here is a javascript that i think will fail:
alert("before");
alert("hello//there");
alert("after");
its the // in the quotes. i guess we do not account for quotes in our stripper.
> javascript comment stripping is erroneous
> -----------------------------------------
>
> Key: WICKET-501
> URL: https://issues.apache.org/jira/browse/WICKET-501
> Project: Wicket
> Issue Type: Bug
> Components: wicket
> Reporter: Peter Ertl
> Assigned To: Jean-Baptiste Quenot
> Priority: Critical
> Attachments: 20070425-WICKET-501-JavascriptStripper.txt
>
>
> The following line is crippled when using javascript comment stripping
> (from jquery.js)
> // Handle the common XPath // expression
> if ( !t.indexOf("//") ) {
> it will be result in
> if ( !t.indexOf("
> the // inside the string quotes are taken as a comment instead of as a string...
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Updated: (WICKET-501) javascript comment stripping is
erroneous
Posted by "Peter Ertl (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/WICKET-501?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Peter Ertl updated WICKET-501:
------------------------------
Attachment: (was: jquery.js)
> javascript comment stripping is erroneous
> -----------------------------------------
>
> Key: WICKET-501
> URL: https://issues.apache.org/jira/browse/WICKET-501
> Project: Wicket
> Issue Type: Bug
> Components: wicket
> Reporter: Peter Ertl
> Assignee: Jean-Baptiste Quenot
> Priority: Critical
> Fix For: 1.3.0-beta2
>
> Attachments: 20070425-WICKET-501-JavascriptStripper.txt, jquery-06-19-07.js
>
>
> The following line is crippled when using javascript comment stripping
> (from jquery.js)
> // Handle the common XPath // expression
> if ( !t.indexOf("//") ) {
> it will be result in
> if ( !t.indexOf("
> the // inside the string quotes are taken as a comment instead of as a string...
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Assigned: (WICKET-501) javascript comment stripping is
erroneous
Posted by "Jean-Baptiste Quenot (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/WICKET-501?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Jean-Baptiste Quenot reassigned WICKET-501:
-------------------------------------------
Assignee: Jean-Baptiste Quenot
> javascript comment stripping is erroneous
> -----------------------------------------
>
> Key: WICKET-501
> URL: https://issues.apache.org/jira/browse/WICKET-501
> Project: Wicket
> Issue Type: Bug
> Components: wicket
> Reporter: Peter Ertl
> Assigned To: Jean-Baptiste Quenot
> Priority: Critical
> Attachments: 20070425-WICKET-501-JavascriptStripper.txt
>
>
> The following line is crippled when using javascript comment stripping
> (from jquery.js)
> // Handle the common XPath // expression
> if ( !t.indexOf("//") ) {
> it will be result in
> if ( !t.indexOf("
> the // inside the string quotes are taken as a comment instead of as a string...
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Updated: (WICKET-501) javascript comment stripping is
erroneous
Posted by "Peter Ertl (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/WICKET-501?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Peter Ertl updated WICKET-501:
------------------------------
Attachment: jquery.js
I attached the file where the problem happened to me.
environment:
- jdk1.4.2
- wicket-1.3-snapshot (don't know exact revision)
- sap j2ee web server
[ Show ยป ]
Peter Ertl [26/Apr/07 04:05 AM] I attached the file where the problem happened to me. environment: - jdk1.4.2 - wicket-1.3-snapshot (don't know exact revision) - sap j2ee web server
> javascript comment stripping is erroneous
> -----------------------------------------
>
> Key: WICKET-501
> URL: https://issues.apache.org/jira/browse/WICKET-501
> Project: Wicket
> Issue Type: Bug
> Components: wicket
> Reporter: Peter Ertl
> Assigned To: Jean-Baptiste Quenot
> Priority: Critical
> Attachments: 20070425-WICKET-501-JavascriptStripper.txt, jquery.js
>
>
> The following line is crippled when using javascript comment stripping
> (from jquery.js)
> // Handle the common XPath // expression
> if ( !t.indexOf("//") ) {
> it will be result in
> if ( !t.indexOf("
> the // inside the string quotes are taken as a comment instead of as a string...
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Commented: (WICKET-501) JavaScript comment stripping doesn't
handle regexps
Posted by "Alastair Maw (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/WICKET-501?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12506235 ]
Alastair Maw commented on WICKET-501:
-------------------------------------
There's quite a complex use case to handle, which is coping with the code: foo.match(/"/);
Previously, we went into STRING_DOUBLE_QUOTES mode in the middle of that. I'm now going into POSSIBLE_REG_EXP mode when we encounter a "/", and jumping out of that when we encounter another "/". Of course, this doesn't work if you have divide operators sprinkled around, so I'm also jumping out of it when we encounter new lines. This should hopefully cover enough common cases to make the code 99% as competent at stripping things out as a proper parser would be, without having to worry overly much about doing it all "properly".
This will fail to strip comments in the following example:
myVar = myVar / 3; // make it a third as big
In order to cope with this case, we couldn't really parse the stream char-by-char like we currently do, as we'd need to make sure that wasn't about to be:
myVar = myVar.match( / 3; // make it a third as big /)[0];
...which requires far too much knowledge of how PHP actually works.
> JavaScript comment stripping doesn't handle regexps
> ---------------------------------------------------
>
> Key: WICKET-501
> URL: https://issues.apache.org/jira/browse/WICKET-501
> Project: Wicket
> Issue Type: Bug
> Components: wicket
> Affects Versions: 1.3.0-beta1
> Reporter: Peter Ertl
> Assignee: Alastair Maw
> Priority: Critical
> Fix For: 1.3.0-beta2
>
> Attachments: 20070425-WICKET-501-JavascriptStripper.txt, jquery-06-19-07-stripped.js, jquery-06-19-07.js
>
>
> The following line is crippled when using javascript comment stripping
> (from jquery.js)
> // Handle the common XPath // expression
> if ( !t.indexOf("//") ) {
> it will be result in
> if ( !t.indexOf("
> the // inside the string quotes are taken as a comment instead of as a string...
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Updated: (WICKET-501) javascript comment stripping is
erroneous
Posted by "Peter Ertl (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/WICKET-501?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Peter Ertl updated WICKET-501:
------------------------------
Attachment: jquery-06-19-07-stripped.js
the compressed jquery.js being corrupted
> javascript comment stripping is erroneous
> -----------------------------------------
>
> Key: WICKET-501
> URL: https://issues.apache.org/jira/browse/WICKET-501
> Project: Wicket
> Issue Type: Bug
> Components: wicket
> Reporter: Peter Ertl
> Assignee: Jean-Baptiste Quenot
> Priority: Critical
> Fix For: 1.3.0-beta2
>
> Attachments: 20070425-WICKET-501-JavascriptStripper.txt, jquery-06-19-07-stripped.js, jquery-06-19-07.js
>
>
> The following line is crippled when using javascript comment stripping
> (from jquery.js)
> // Handle the common XPath // expression
> if ( !t.indexOf("//") ) {
> it will be result in
> if ( !t.indexOf("
> the // inside the string quotes are taken as a comment instead of as a string...
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Updated: (WICKET-501) javascript comment stripping is
erroneous
Posted by "Jean-Baptiste Quenot (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/WICKET-501?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Jean-Baptiste Quenot updated WICKET-501:
----------------------------------------
Attachment: 20070425-WICKET-501-JavascriptStripper.txt
The attached patch (with unit test) fixes compression for JavaScript files using CR line endings (Macintosh). Can you try to attach your own test? I can't reproduce the exact same problem.
> javascript comment stripping is erroneous
> -----------------------------------------
>
> Key: WICKET-501
> URL: https://issues.apache.org/jira/browse/WICKET-501
> Project: Wicket
> Issue Type: Bug
> Components: wicket
> Reporter: Peter Ertl
> Priority: Critical
> Attachments: 20070425-WICKET-501-JavascriptStripper.txt
>
>
> The following line is crippled when using javascript comment stripping
> (from jquery.js)
> // Handle the common XPath // expression
> if ( !t.indexOf("//") ) {
> it will be result in
> if ( !t.indexOf("
> the // inside the string quotes are taken as a comment instead of as a string...
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Updated: (WICKET-501) JavaScript comment stripping doesn't
handle // inside String literals.
Posted by "Alastair Maw (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/WICKET-501?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Alastair Maw updated WICKET-501:
--------------------------------
Summary: JavaScript comment stripping doesn't handle // inside String literals. (was: javascript comment stripping is erroneous)
> JavaScript comment stripping doesn't handle // inside String literals.
> -----------------------------------------------------------------------
>
> Key: WICKET-501
> URL: https://issues.apache.org/jira/browse/WICKET-501
> Project: Wicket
> Issue Type: Bug
> Components: wicket
> Reporter: Peter Ertl
> Assignee: Jean-Baptiste Quenot
> Priority: Critical
> Fix For: 1.3.0-beta2
>
> Attachments: 20070425-WICKET-501-JavascriptStripper.txt, jquery-06-19-07-stripped.js, jquery-06-19-07.js
>
>
> The following line is crippled when using javascript comment stripping
> (from jquery.js)
> // Handle the common XPath // expression
> if ( !t.indexOf("//") ) {
> it will be result in
> if ( !t.indexOf("
> the // inside the string quotes are taken as a comment instead of as a string...
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Issue Comment Edited: (WICKET-501) javascript comment
stripping is erroneous
Posted by "Peter Ertl (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/WICKET-501?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12506204 ]
Peter Ertl edited comment on WICKET-501 at 6/19/07 8:25 AM:
------------------------------------------------------------
upload: the compressed jquery.js being corrupted
was:
the compressed jquery.js being corrupted
> javascript comment stripping is erroneous
> -----------------------------------------
>
> Key: WICKET-501
> URL: https://issues.apache.org/jira/browse/WICKET-501
> Project: Wicket
> Issue Type: Bug
> Components: wicket
> Reporter: Peter Ertl
> Assignee: Jean-Baptiste Quenot
> Priority: Critical
> Fix For: 1.3.0-beta2
>
> Attachments: 20070425-WICKET-501-JavascriptStripper.txt, jquery-06-19-07-stripped.js, jquery-06-19-07.js
>
>
> The following line is crippled when using javascript comment stripping
> (from jquery.js)
> // Handle the common XPath // expression
> if ( !t.indexOf("//") ) {
> it will be result in
> if ( !t.indexOf("
> the // inside the string quotes are taken as a comment instead of as a string...
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Updated: (WICKET-501) JavaScript comment stripping doesn't
handle regexps
Posted by "Alastair Maw (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/WICKET-501?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Alastair Maw updated WICKET-501:
--------------------------------
Summary: JavaScript comment stripping doesn't handle regexps (was: JavaScript comment stripping doesn't handle // inside String literals. )
Actually, it doesn't handle the regexps above that properly, and therefore thinks it's in the middle of a string.
> JavaScript comment stripping doesn't handle regexps
> ---------------------------------------------------
>
> Key: WICKET-501
> URL: https://issues.apache.org/jira/browse/WICKET-501
> Project: Wicket
> Issue Type: Bug
> Components: wicket
> Affects Versions: 1.3.0-beta1
> Reporter: Peter Ertl
> Assignee: Alastair Maw
> Priority: Critical
> Fix For: 1.3.0-beta2
>
> Attachments: 20070425-WICKET-501-JavascriptStripper.txt, jquery-06-19-07-stripped.js, jquery-06-19-07.js
>
>
> The following line is crippled when using javascript comment stripping
> (from jquery.js)
> // Handle the common XPath // expression
> if ( !t.indexOf("//") ) {
> it will be result in
> if ( !t.indexOf("
> the // inside the string quotes are taken as a comment instead of as a string...
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Commented: (WICKET-501) javascript comment stripping is
erroneous
Posted by "Jean-Baptiste Quenot (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/WICKET-501?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12491782 ]
Jean-Baptiste Quenot commented on WICKET-501:
---------------------------------------------
Can you attach the jquery.js file (just for diagnosing)? What is the environment (platform, etc)?
> javascript comment stripping is erroneous
> -----------------------------------------
>
> Key: WICKET-501
> URL: https://issues.apache.org/jira/browse/WICKET-501
> Project: Wicket
> Issue Type: Bug
> Components: wicket
> Reporter: Peter Ertl
> Priority: Critical
>
> The following line is crippled when using javascript comment stripping
> (from jquery.js)
> // Handle the common XPath // expression
> if ( !t.indexOf("//") ) {
> it will be result in
> if ( !t.indexOf("
> the // inside the string quotes are taken as a comment instead of as a string...
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Commented: (WICKET-501) JavaScript comment stripping doesn't
handle regexps
Posted by "Alastair Maw (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/WICKET-501?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12506236 ]
Alastair Maw commented on WICKET-501:
-------------------------------------
(That latest fix in r548788.)
> JavaScript comment stripping doesn't handle regexps
> ---------------------------------------------------
>
> Key: WICKET-501
> URL: https://issues.apache.org/jira/browse/WICKET-501
> Project: Wicket
> Issue Type: Bug
> Components: wicket
> Affects Versions: 1.3.0-beta1
> Reporter: Peter Ertl
> Assignee: Alastair Maw
> Priority: Critical
> Fix For: 1.3.0-beta2
>
> Attachments: 20070425-WICKET-501-JavascriptStripper.txt, jquery-06-19-07-stripped.js, jquery-06-19-07.js
>
>
> The following line is crippled when using javascript comment stripping
> (from jquery.js)
> // Handle the common XPath // expression
> if ( !t.indexOf("//") ) {
> it will be result in
> if ( !t.indexOf("
> the // inside the string quotes are taken as a comment instead of as a string...
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Updated: (WICKET-501) JavaScript comment stripping doesn't
handle regexps
Posted by "Alastair Maw (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/WICKET-501?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Alastair Maw updated WICKET-501:
--------------------------------
Uh, how *JavaScript* works. Where's my coffee gone? ;-)
> JavaScript comment stripping doesn't handle regexps
> ---------------------------------------------------
>
> Key: WICKET-501
> URL: https://issues.apache.org/jira/browse/WICKET-501
> Project: Wicket
> Issue Type: Bug
> Components: wicket
> Affects Versions: 1.3.0-beta1
> Reporter: Peter Ertl
> Assignee: Alastair Maw
> Priority: Critical
> Fix For: 1.3.0-beta2
>
> Attachments: 20070425-WICKET-501-JavascriptStripper.txt, jquery-06-19-07-stripped.js, jquery-06-19-07.js
>
>
> The following line is crippled when using javascript comment stripping
> (from jquery.js)
> // Handle the common XPath // expression
> if ( !t.indexOf("//") ) {
> it will be result in
> if ( !t.indexOf("
> the // inside the string quotes are taken as a comment instead of as a string...
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Commented: (WICKET-501) JavaScript comment stripping doesn't
handle regexps
Posted by "Alastair Maw (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/WICKET-501?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12506241 ]
Alastair Maw commented on WICKET-501:
-------------------------------------
Right, I now back up when we find a '/' to work out if we're a regexp or not, so this should actually fix all the use-cases again (r548790).
> JavaScript comment stripping doesn't handle regexps
> ---------------------------------------------------
>
> Key: WICKET-501
> URL: https://issues.apache.org/jira/browse/WICKET-501
> Project: Wicket
> Issue Type: Bug
> Components: wicket
> Affects Versions: 1.3.0-beta1
> Reporter: Peter Ertl
> Assignee: Alastair Maw
> Priority: Critical
> Fix For: 1.3.0-beta2
>
> Attachments: 20070425-WICKET-501-JavascriptStripper.txt, jquery-06-19-07-stripped.js, jquery-06-19-07.js
>
>
> The following line is crippled when using javascript comment stripping
> (from jquery.js)
> // Handle the common XPath // expression
> if ( !t.indexOf("//") ) {
> it will be result in
> if ( !t.indexOf("
> the // inside the string quotes are taken as a comment instead of as a string...
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.