[Webkit-unassigned] [Bug 173053] New: \n\r is not the same as \r\n

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Wed Jun 7 04:34:56 PDT 2017


https://bugs.webkit.org/show_bug.cgi?id=173053

            Bug ID: 173053
           Summary: \n\r is not the same as \r\n
           Product: WebKit
           Version: WebKit Nightly Build
          Hardware: Unspecified
                OS: Unspecified
            Status: NEW
          Severity: Normal
          Priority: P2
         Component: JavaScriptCore
          Assignee: webkit-unassigned at lists.webkit.org
          Reporter: webkit at qfox.nl

What steps will reproduce the problem?
1. eval("'\\\n\r'")

What is the expected output?

Uncaught SyntaxError: Invalid or unexpected token

What do you see instead?

A parser bug! :)

Description:

The spec explicitly treats `\r\n` as a single newline token rather than two but individual `\n` and `\r` characters cause individual newline tokens. When back-to-back `\n\r` causes two tokens. This is normally not very relevant, only to the point of line number reporting, but there's an edge case concerning so called "newline escapes" in single/double strings; Escaping a newline there takes this distinction into account and `'\\\r\n'` should be fine while `'\\\n\r'` should trigger an error on an unescaped `\r`.

See also https://bugs.chromium.org/p/v8/issues/detail?id=6401

-- 
You are receiving this mail because:
You are the assignee for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.webkit.org/pipermail/webkit-unassigned/attachments/20170607/08fe7370/attachment.html>


More information about the webkit-unassigned mailing list