Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

Short-circuit for Element#down() without arguments #61

Merged
merged 1 commit into from

2 participants

@victor-homyakov

Prevent selecting ALL descendants with Prototype.Selector.select('*', element) when invoking Element#down() without arguments

@victor-homyakov victor-homyakov Short-circuit for Element#down() without arguments
Prevent selecting ALL descendants with `Prototype.Selector.select('*', element)` when invoking Element#down() without arguments
2dfb3ae
@savetheclocktower savetheclocktower merged commit 745bea6 into from
@victor-homyakov victor-homyakov deleted the branch
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Aug 28, 2012
  1. @victor-homyakov

    Short-circuit for Element#down() without arguments

    victor-homyakov authored
    Prevent selecting ALL descendants with `Prototype.Selector.select('*', element)` when invoking Element#down() without arguments
This page is out of date. Refresh to see the latest.
Showing with 1 addition and 0 deletions.
  1. +1 −0  src/prototype/dom/dom.js
View
1  src/prototype/dom/dom.js
@@ -1775,6 +1775,7 @@
* // -> undefined
**/
function down(element, expression, index) {
+ if (arguments.length === 1) return firstDescendant(element);
element = $(element), expression = expression || 0, index = index || 0;
if (Object.isNumber(expression))
Something went wrong with that request. Please try again.