[SCM] WebKit Debian packaging branch, debian/experimental, updated. upstream/1.3.3-9427-gc2be6fc

oliver at apple.com oliver at apple.com
Wed Dec 22 12:39:42 UTC 2010


The following commit has been merged in the debian/experimental branch:
commit cfcab90f1b0ea490ca8e3b7324744f082003b39e
Author: oliver at apple.com <oliver at apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date:   Thu Aug 26 21:24:46 2010 +0000

    2010-08-26  Oliver Hunt  <oliver at apple.com>
    
            Reviewed by Gavin Barraclough.
    
            [JSC] JavaScript parsing error when loading Equifax web page
            https://bugs.webkit.org/show_bug.cgi?id=42900
    
            '-->' is ostensibly only meant to occur when there is only
            whitespace preceeding it on the line.  However firefox treats
            multiline comments as a space character, so they are allowed.
            One side effect of the firefox model is that any line terminators
            inside the multiline comment are ignored, so
    
                foo/*
                */-->
    
            is treated as
    
                foo -->
    
            and so '-->' will not be a comment in this case.  Happily this simply
            means that to fix this issue all we need to do is stop updating
            m_atLineStart when handling multiline comments.
    
            * parser/Lexer.cpp:
            (JSC::Lexer::lex):
    2010-08-26  Oliver Hunt  <oliver at apple.com>
    
            Reviewed by Gavin Barraclough.
    
            [JSC] JavaScript parsing error when loading Equifax web page
            https://bugs.webkit.org/show_bug.cgi?id=42900
    
            Add tests for the many idiosyncrasies of --> comments
    
            * fast/js/parser-xml-close-comment-expected.txt: Added.
            * fast/js/parser-xml-close-comment.html: Added.
            * fast/js/script-tests/parser-high-byte-character.js:
            * fast/js/script-tests/parser-xml-close-comment.js: Added.
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@66135 268f45cc-cd09-0410-ab3c-d52691b4dbfc

diff --git a/JavaScriptCore/ChangeLog b/JavaScriptCore/ChangeLog
index 487c3d2..e9c54ee 100644
--- a/JavaScriptCore/ChangeLog
+++ b/JavaScriptCore/ChangeLog
@@ -1,3 +1,30 @@
+2010-08-26  Oliver Hunt  <oliver at apple.com>
+
+        Reviewed by Gavin Barraclough.
+
+        [JSC] JavaScript parsing error when loading Equifax web page
+        https://bugs.webkit.org/show_bug.cgi?id=42900
+
+        '-->' is ostensibly only meant to occur when there is only
+        whitespace preceeding it on the line.  However firefox treats
+        multiline comments as a space character, so they are allowed.
+        One side effect of the firefox model is that any line terminators
+        inside the multiline comment are ignored, so
+
+            foo/*
+            */-->
+
+        is treated as
+
+            foo -->
+
+        and so '-->' will not be a comment in this case.  Happily this simply
+        means that to fix this issue all we need to do is stop updating
+        m_atLineStart when handling multiline comments.
+
+        * parser/Lexer.cpp:
+        (JSC::Lexer::lex):
+
 2010-08-25  Oliver Hunt  <oliver at apple.com>
 
         Reviewed by Geoffrey Garen.
diff --git a/JavaScriptCore/parser/Lexer.cpp b/JavaScriptCore/parser/Lexer.cpp
index 877e89a..f9e62e1 100644
--- a/JavaScriptCore/parser/Lexer.cpp
+++ b/JavaScriptCore/parser/Lexer.cpp
@@ -875,7 +875,6 @@ inMultiLineComment:
             shift();
     }
     shift();
-    m_atLineStart = false;
     goto start;
 
 startNumberWithZeroDigit:
diff --git a/LayoutTests/ChangeLog b/LayoutTests/ChangeLog
index e8e54c2..84cc0e2 100644
--- a/LayoutTests/ChangeLog
+++ b/LayoutTests/ChangeLog
@@ -1,3 +1,17 @@
+2010-08-26  Oliver Hunt  <oliver at apple.com>
+
+        Reviewed by Gavin Barraclough.
+
+        [JSC] JavaScript parsing error when loading Equifax web page
+        https://bugs.webkit.org/show_bug.cgi?id=42900
+
+        Add tests for the many idiosyncrasies of --> comments
+
+        * fast/js/parser-xml-close-comment-expected.txt: Added.
+        * fast/js/parser-xml-close-comment.html: Added.
+        * fast/js/script-tests/parser-high-byte-character.js:
+        * fast/js/script-tests/parser-xml-close-comment.js: Added.
+
 2010-08-26  Tony Chang  <tony at chromium.org>
 
         Reviewed by Ojan Vafai.
diff --git a/LayoutTests/fast/js/parser-xml-close-comment-expected.txt b/LayoutTests/fast/js/parser-xml-close-comment-expected.txt
new file mode 100644
index 0000000..ac6b238
--- /dev/null
+++ b/LayoutTests/fast/js/parser-xml-close-comment-expected.txt
@@ -0,0 +1,18 @@
+Test to ensure correct handling of --> as a single line comment when at the beginning of a line
+
+On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
+
+
+PASS 'should be a syntax error' --> threw exception SyntaxError: Parse error.
+PASS /**/ 1 --> threw exception SyntaxError: Parse error.
+PASS 1 /**/ --> threw exception SyntaxError: Parse error.
+PASS 1/*
+*/--> threw exception SyntaxError: Parse error.
+PASS --> is undefined.
+PASS /**/--> is undefined.
+PASS /*
+*/--> is undefined.
+PASS successfullyParsed is true
+
+TEST COMPLETE
+
diff --git a/LayoutTests/fast/js/parser-xml-close-comment.html b/LayoutTests/fast/js/parser-xml-close-comment.html
new file mode 100644
index 0000000..e1d631d
--- /dev/null
+++ b/LayoutTests/fast/js/parser-xml-close-comment.html
@@ -0,0 +1,13 @@
+<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN">
+<html>
+<head>
+<link rel="stylesheet" href="resources/js-test-style.css">
+<script src="resources/js-test-pre.js"></script>
+</head>
+<body>
+<p id="description"></p>
+<div id="console"></div>
+<script src="script-tests/parser-xml-close-comment.js"></script>
+<script src="resources/js-test-post.js"></script>
+</body>
+</html>
diff --git a/LayoutTests/fast/js/script-tests/parser-high-byte-character.js b/LayoutTests/fast/js/script-tests/parser-high-byte-character.js
index 8f5b59b..3a9b9d1 100644
--- a/LayoutTests/fast/js/script-tests/parser-high-byte-character.js
+++ b/LayoutTests/fast/js/script-tests/parser-high-byte-character.js
@@ -25,3 +25,5 @@ XXXXXXXXXXXXXXXXXXXXXXXX
 
 var successfullyParsed = true;
 
+
+var successfullyParsed = true;
diff --git a/LayoutTests/fast/js/script-tests/parser-xml-close-comment.js b/LayoutTests/fast/js/script-tests/parser-xml-close-comment.js
new file mode 100644
index 0000000..dcd335b
--- /dev/null
+++ b/LayoutTests/fast/js/script-tests/parser-xml-close-comment.js
@@ -0,0 +1,12 @@
+description("Test to ensure correct handling of --> as a single line comment when at the beginning of a line");
+
+shouldThrow("'should be a syntax error' -->");
+shouldThrow("/**/ 1 -->");
+shouldThrow("1 /**/ -->");
+shouldThrow("1/*\n*/-->");
+
+shouldBeUndefined("-->");
+shouldBeUndefined("/**/-->");
+shouldBeUndefined("/*\n*/-->");
+
+var successfullyParsed = true;

-- 
WebKit Debian packaging



More information about the Pkg-webkit-commits mailing list