<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<!DOCTYPE bugzilla SYSTEM "https://bugs.webkit.org/page.cgi?id=bugzilla.dtd">

<bugzilla version="5.0.4.1"
          urlbase="https://bugs.webkit.org/"
          
          maintainer="admin@webkit.org"
>

    <bug>
          <bug_id>165453</bug_id>
          
          <creation_ts>2016-12-05 20:01:33 -0800</creation_ts>
          <short_desc>check-webkit-style: false positive caused by regex literal matching in SingleQuoteChecker</short_desc>
          <delta_ts>2017-07-20 15:59:07 -0700</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>1</classification_id>
          <classification>Unclassified</classification>
          <product>WebKit</product>
          <component>Tools / Tests</component>
          <version>WebKit Nightly Build</version>
          <rep_platform>Unspecified</rep_platform>
          <op_sys>Unspecified</op_sys>
          <bug_status>NEW</bug_status>
          <resolution></resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords>InRadar</keywords>
          <priority>P2</priority>
          <bug_severity>Normal</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Matt Baker">mattbaker</reporter>
          <assigned_to name="Nobody">webkit-unassigned</assigned_to>
          <cc>joepeck</cc>
    
    <cc>lforschler</cc>
    
    <cc>ross.kirsling</cc>
    
    <cc>webkit-bug-importer</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>1256690</commentid>
    <comment_count>0</comment_count>
    <who name="Matt Baker">mattbaker</who>
    <bug_when>2016-12-05 20:01:33 -0800</bug_when>
    <thetext>SingleQuoteChecker strips out regex literals before checking for single quotes, which is a good thing. Unfortunately, the regex that does this matches the wrong thing when a regex contains a forward slash:

Tools/Scripts/webkitpy/style/checkers/js.py: 88:
line = re.sub(&apos;/.+?/&apos;, &apos;//&apos;, line)

Input:  /[/&apos;&quot;]/
Expect: ^-----^
Actual: ^-^

Output: //&apos;&quot;]/</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1256692</commentid>
    <comment_count>1</comment_count>
    <who name="Matt Baker">mattbaker</who>
    <bug_when>2016-12-05 20:07:46 -0800</bug_when>
    <thetext>Forward slash should be escaped:

Input:  /[\/&apos;&quot;]/
Expect: ^------^
Actual: ^--^</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1307021</commentid>
    <comment_count>2</comment_count>
    <who name="Ross Kirsling">ross.kirsling</who>
    <bug_when>2017-05-10 14:44:06 -0700</bug_when>
    <thetext>This checker has many other problems too -- it doesn&apos;t support template strings, it doesn&apos;t allow multiline strings to share a line with actual code, and it doesn&apos;t allow you to start a line with (whitespace and) a multiplication operator.

Given that ESLint does this properly with an actual parser, it would seem advisable to drop this checker altogether.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1307027</commentid>
    <comment_count>3</comment_count>
    <who name="Ross Kirsling">ross.kirsling</who>
    <bug_when>2017-05-10 14:56:17 -0700</bug_when>
    <thetext>To be clearer:

&gt; return `&apos;${foo}&apos;`;
is viewed as an error, while 

&gt; return &apos;foo&apos;; /* bar */
is not.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1330812</commentid>
    <comment_count>4</comment_count>
    <who name="Radar WebKit Bug Importer">webkit-bug-importer</who>
    <bug_when>2017-07-20 15:59:07 -0700</bug_when>
    <thetext>&lt;rdar://problem/33440119&gt;</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>