Bug 170648

Summary: test262: test262/test/annexB/language/comments/multi-line-html-close.js
Product: WebKit Reporter: Joseph Pecoraro <joepeck>
Component: JavaScriptCoreAssignee: Joseph Pecoraro <joepeck>
Status: RESOLVED FIXED    
Severity: Normal CC: buildbot, commit-queue, joepeck, keith_miller, mark.lam, msaboff, saam
Priority: P2    
Version: WebKit Nightly Build   
Hardware: All   
OS: All   
Attachments:
Description Flags
[PATCH] Proposed Fix none

Description Joseph Pecoraro 2017-04-08 17:28:54 PDT
A multi-line multi-line comment with HTML Closing Comment should treat trailing content like HTML Closing Comment (single line comment)

Test:
1/*
*/--> This should be a comment

Expected:
1

Result:
SyntaxError

Test:
test262/test/annexB/language/comments/multi-line-html-close.js
Comment 1 Joseph Pecoraro 2017-04-08 17:31:41 PDT
Created attachment 306586 [details]
[PATCH] Proposed Fix
Comment 2 Joseph Pecoraro 2017-04-08 17:33:49 PDT
Comment on attachment 306586 [details]
[PATCH] Proposed Fix

View in context: https://bugs.webkit.org/attachment.cgi?id=306586&action=review

> Source/JavaScriptCore/parser/Lexer.cpp:1994
> +            if ((m_atLineStart || m_terminator) && m_current == '>') {

I might be able to just drop m_atLineStart entirely and just use m_terminator.
Comment 3 Joseph Pecoraro 2017-04-08 17:39:28 PDT
Comment on attachment 306586 [details]
[PATCH] Proposed Fix

Yes, I think I can drop the entire variable. Existing tests pass I'm going to add a few more.
Comment 4 Joseph Pecoraro 2017-04-08 17:40:47 PDT
> Yes, I think I can drop the entire variable. Existing tests pass I'm going
> to add a few more.

Nope I lied, existing tests did not pass. Leaving patch as it is!
Comment 5 Joseph Pecoraro 2017-04-09 12:32:34 PDT
Comment on attachment 306586 [details]
[PATCH] Proposed Fix

View in context: https://bugs.webkit.org/attachment.cgi?id=306586&action=review

>> Source/JavaScriptCore/parser/Lexer.cpp:1994
>> +            if ((m_atLineStart || m_terminator) && m_current == '>') {
> 
> I might be able to just drop m_atLineStart entirely and just use m_terminator.

Nope. Other tests failed. Patch is reviewable as is.
Comment 6 Joseph Pecoraro 2017-04-10 22:51:41 PDT
Ping reviewers
Comment 7 Keith Miller 2017-04-11 09:26:13 PDT
Comment on attachment 306586 [details]
[PATCH] Proposed Fix

View in context: https://bugs.webkit.org/attachment.cgi?id=306586&action=review

r=me.

> LayoutTests/js/parser-xml-close-comment-expected.txt:1
> +Test to ensure correct handling of --> as a single line comment when at the beginning of a line or preceeded by a multi-line comment

Wow, I didn't know this was a thing... weird
Comment 8 WebKit Commit Bot 2017-04-11 09:54:52 PDT
Comment on attachment 306586 [details]
[PATCH] Proposed Fix

Clearing flags on attachment: 306586

Committed r215235: <http://trac.webkit.org/changeset/215235>
Comment 9 WebKit Commit Bot 2017-04-11 09:54:54 PDT
All reviewed patches have been landed.  Closing bug.