JavaScriptCore/ChangeLog

 12010-08-26 Oliver Hunt <oliver@apple.com>
 2
 3 Reviewed by NOBODY (OOPS!).
 4
 5 [JSC] JavaScript parsing error when loading Equifax web page
 6 https://bugs.webkit.org/show_bug.cgi?id=42900
 7
 8 '-->' is ostensibly only meant to occur when there is only
 9 whitespace preceeding it on the line. However firefox treats
 10 multiline comments as a space character, so they are allowed.
 11 One side effect of the firefox model is that any line terminators
 12 inside the multiline comment are ignored, so
 13
 14 foo/*
 15 */-->
 16
 17 is treated as
 18
 19 foo -->
 20
 21 and so '-->' will not be a comment in this case. Happily this simply
 22 means that to fix this issue all we need to do is stop updating
 23 m_atLineStart when handling multiline comments.
 24
 25 * parser/Lexer.cpp:
 26 (JSC::Lexer::lex):
 27
1282010-08-25 Oliver Hunt <oliver@apple.com>
229
330 Reviewed by Geoffrey Garen.

JavaScriptCore/parser/Lexer.cpp

@@inMultiLineComment:
875875 shift();
876876 }
877877 shift();
878  m_atLineStart = false;
879878 goto start;
880879
881880startNumberWithZeroDigit:

LayoutTests/ChangeLog

 12010-08-26 Oliver Hunt <oliver@apple.com>
 2
 3 Reviewed by NOBODY (OOPS!).
 4
 5 [JSC] JavaScript parsing error when loading Equifax web page
 6 https://bugs.webkit.org/show_bug.cgi?id=42900
 7
 8 Add tests for the many idiosyncrasies of --> comments
 9
 10 * fast/js/parser-xml-close-comment-expected.txt: Added.
 11 * fast/js/parser-xml-close-comment.html: Added.
 12 * fast/js/script-tests/parser-high-byte-character.js:
 13 * fast/js/script-tests/parser-xml-close-comment.js: Added.
 14
1152010-08-26 Eric Carlson <eric.carlson@apple.com>
216
317 Reviewed by Darin Adler and Maciej Stachowiak.

LayoutTests/fast/js/parser-xml-close-comment-expected.txt

 1Test to ensure correct handling of --> as a single line comment when at the beginning of a line
 2
 3On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
 4
 5
 6PASS 'should be a syntax error' --> threw exception SyntaxError: Parse error.
 7PASS /**/ 1 --> threw exception SyntaxError: Parse error.
 8PASS 1 /**/ --> threw exception SyntaxError: Parse error.
 9PASS 1/*
 10*/--> threw exception SyntaxError: Parse error.
 11PASS --> is undefined.
 12PASS /**/--> is undefined.
 13PASS /*
 14*/--> is undefined.
 15PASS successfullyParsed is true
 16
 17TEST COMPLETE
 18

LayoutTests/fast/js/parser-xml-close-comment.html

 1<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN">
 2<html>
 3<head>
 4<link rel="stylesheet" href="resources/js-test-style.css">
 5<script src="resources/js-test-pre.js"></script>
 6</head>
 7<body>
 8<p id="description"></p>
 9<div id="console"></div>
 10<script src="script-tests/parser-xml-close-comment.js"></script>
 11<script src="resources/js-test-post.js"></script>
 12</body>
 13</html>

LayoutTests/fast/js/script-tests/parser-high-byte-character.js

@@XXXXXXXXXXXXXXXXXXXXXXXX
2525
2626var successfullyParsed = true;
2727
 28
 29var successfullyParsed = true;

LayoutTests/fast/js/script-tests/parser-xml-close-comment.js

 1description("Test to ensure correct handling of --> as a single line comment when at the beginning of a line");
 2
 3shouldThrow("'should be a syntax error' -->");
 4shouldThrow("/**/ 1 -->");
 5shouldThrow("1 /**/ -->");
 6shouldThrow("1/*\n*/-->");
 7
 8shouldBeUndefined("-->");
 9shouldBeUndefined("/**/-->");
 10shouldBeUndefined("/*\n*/-->");
 11
 12var successfullyParsed = true;