Skip to content

Commit 745bea6

Browse files
Merge pull request prototypejs#61 from victor-homyakov/patch-17
Optimize the case when `Element.down` is called without any arguments.
2 parents 4577941 + 2dfb3ae commit 745bea6

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

src/prototype/dom/dom.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1775,6 +1775,7 @@
17751775
* // -> undefined
17761776
**/
17771777
function down(element, expression, index) {
1778+
if (arguments.length === 1) return firstDescendant(element);
17781779
element = $(element), expression = expression || 0, index = index || 0;
17791780

17801781
if (Object.isNumber(expression))

0 commit comments

Comments
 (0)