<?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>207755</bug_id>
          
          <creation_ts>2020-02-14 04:29:04 -0800</creation_ts>
          <short_desc>bugzilla code-review.js: RangeError: too many arguments provided for a function call</short_desc>
          <delta_ts>2020-02-14 06:50:12 -0800</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>
          
          <see_also>https://bugs.webkit.org/show_bug.cgi?id=207644</see_also>
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords></keywords>
          <priority>P2</priority>
          <bug_severity>Normal</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Carlos Alberto Lopez Perez">clopez</reporter>
          <assigned_to name="Nobody">webkit-unassigned</assigned_to>
          
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>1618934</commentid>
    <comment_count>0</comment_count>
    <who name="Carlos Alberto Lopez Perez">clopez</who>
    <bug_when>2020-02-14 04:29:04 -0800</bug_when>
    <thetext>While trying to use the code review tool on https://bugs.webkit.org/attachment.cgi?id=390714&amp;action=review there is a fatal JS error:

RangeError: too many arguments provided for a function call jquery-1.4.2.min.js:87:93
    jQuery 6
        z
        k
        k
        find
        init
        c
    crawlDiff https://bugs.webkit.org/code-review.js?version=48:604
    handleDocumentReady https://bugs.webkit.org/code-review.js?version=48:1100
    jQuery 2
        ready
        L


It seems this line &quot;$(&apos;.Line&apos;).each(idify).each(hoverify);&quot; at  line 604 of https://bugs.webkit.org/code-review.js?version=48 causes the issue.
Source here: https://trac.webkit.org/browser/webkit/trunk/Websites/bugs.webkit.org/code-review.js?rev=256519#L604</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1618938</commentid>
    <comment_count>1</comment_count>
    <who name="Carlos Alberto Lopez Perez">clopez</who>
    <bug_when>2020-02-14 04:35:06 -0800</bug_when>
    <thetext>That traceback above was from Firefox, Chrome shows it like:

Uncaught RangeError: Maximum call stack size exceeded
    at z (jquery-1.4.2.min.js:87)
    at k (jquery-1.4.2.min.js:73)
    at Function.k [as find] (jquery-1.4.2.min.js:91)
    at init.find (jquery-1.4.2.min.js:95)
    at new init (jquery-1.4.2.min.js:23)
    at c (jquery-1.4.2.min.js:20)
    at crawlDiff (VM2067 code-review.js:604)
    at HTMLDocument.handleDocumentReady (VM2067 code-review.js:1100)
    at Function.ready (jquery-1.4.2.min.js:26)
    at HTMLDocument.L (jquery-1.4.2.min.js:33)</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1618941</commentid>
    <comment_count>2</comment_count>
    <who name="Carlos Alberto Lopez Perez">clopez</who>
    <bug_when>2020-02-14 05:12:29 -0800</bug_when>
    <thetext>it is caused by the jquery selector for Line


&gt; $(&apos;.Line&apos;)
jquery-1.4.2.min.js:87 Uncaught RangeError: Maximum call stack size exceeded
    at z (jquery-1.4.2.min.js:87)
    at k (jquery-1.4.2.min.js:73)
    at Function.k [as find] (jquery-1.4.2.min.js:91)
    at init.find (jquery-1.4.2.min.js:95)
    at new init (jquery-1.4.2.min.js:23)
    at c (jquery-1.4.2.min.js:20)
    at &lt;anonymous&gt;:1:1


However this works:
&gt; document.getElementsByClassName(&apos;Line&apos;).length
616466</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1618956</commentid>
    <comment_count>3</comment_count>
    <who name="Carlos Alberto Lopez Perez">clopez</who>
    <bug_when>2020-02-14 06:50:12 -0800</bug_when>
    <thetext>something like this seems to workaround the RangeError issue


- $(&apos;.Line&apos;).each(idify).each(hoverify);
+  var line_elements = document.getElementsByClassName(&apos;Line&apos;);
+   for (var i = 0; i &lt; line_elements.length; i++)
+     jQuery(line_elements[i]).each(idify).each(hoverify);


But chrome ends crashing anyway :\

Didn&apos;t tried with other browser because its much harder to edit/test JS live.</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>