Bug 207755
Summary: | bugzilla code-review.js: RangeError: too many arguments provided for a function call | ||
---|---|---|---|
Product: | WebKit | Reporter: | Carlos Alberto Lopez Perez <clopez> |
Component: | Tools / Tests | Assignee: | Nobody <webkit-unassigned> |
Status: | NEW | ||
Severity: | Normal | ||
Priority: | P2 | ||
Version: | WebKit Nightly Build | ||
Hardware: | Unspecified | ||
OS: | Unspecified | ||
See Also: | https://bugs.webkit.org/show_bug.cgi?id=207644 |
Carlos Alberto Lopez Perez
While trying to use the code review tool on https://bugs.webkit.org/attachment.cgi?id=390714&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 "$('.Line').each(idify).each(hoverify);" 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
Attachments | ||
---|---|---|
Add attachment proposed patch, testcase, etc. |
Carlos Alberto Lopez Perez
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)
Carlos Alberto Lopez Perez
it is caused by the jquery selector for Line
> $('.Line')
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 <anonymous>:1:1
However this works:
> document.getElementsByClassName('Line').length
616466
Carlos Alberto Lopez Perez
something like this seems to workaround the RangeError issue
- $('.Line').each(idify).each(hoverify);
+ var line_elements = document.getElementsByClassName('Line');
+ for (var i = 0; i < line_elements.length; i++)
+ jQuery(line_elements[i]).each(idify).each(hoverify);
But chrome ends crashing anyway :\
Didn't tried with other browser because its much harder to edit/test JS live.