Permalink
Browse files

check for undefined argument in array methods (fixes #2529933)

  • Loading branch information...
msweeney committed Feb 3, 2011
1 parent b586e8b commit 06e08ffe36f95d2bc2a638ad0cf543703d78af6b
@@ -2187,7 +2187,7 @@ Y.Array.each(ArrayMethods, function(name) {
i = 0,
arg;
while ((arg = arguments[i++])) { // use DOM nodes/nodeLists
while (typeof (arg = arguments[i++]) != 'undefined') { // use DOM nodes/nodeLists
args.push(arg._node || arg._nodes || arg);
}
return Y.Node.scrubVal(ArrayProto[name].apply(this._nodes, args));

Large diffs are not rendered by default.

Oops, something went wrong.
View
@@ -2181,7 +2181,7 @@ Y.Array.each(ArrayMethods, function(name) {
i = 0,
arg;
while ((arg = arguments[i++])) { // use DOM nodes/nodeLists
while (typeof (arg = arguments[i++]) != 'undefined') { // use DOM nodes/nodeLists
args.push(arg._node || arg._nodes || arg);
}
return Y.Node.scrubVal(ArrayProto[name].apply(this._nodes, args));
View
@@ -2187,7 +2187,7 @@ Y.Array.each(ArrayMethods, function(name) {
i = 0,
arg;
while ((arg = arguments[i++])) { // use DOM nodes/nodeLists
while (typeof (arg = arguments[i++]) != 'undefined') { // use DOM nodes/nodeLists
args.push(arg._node || arg._nodes || arg);
}
return Y.Node.scrubVal(ArrayProto[name].apply(this._nodes, args));
View

Large diffs are not rendered by default.

Oops, something went wrong.
View
@@ -2181,7 +2181,7 @@ Y.Array.each(ArrayMethods, function(name) {
i = 0,
arg;
while ((arg = arguments[i++])) { // use DOM nodes/nodeLists
while (typeof (arg = arguments[i++]) != 'undefined') { // use DOM nodes/nodeLists
args.push(arg._node || arg._nodes || arg);
}
return Y.Node.scrubVal(ArrayProto[name].apply(this._nodes, args));
@@ -64,7 +64,7 @@ Y.Array.each(ArrayMethods, function(name) {
i = 0,
arg;
while ((arg = arguments[i++])) { // use DOM nodes/nodeLists
while (typeof (arg = arguments[i++]) != 'undefined') { // use DOM nodes/nodeLists
args.push(arg._node || arg._nodes || arg);
}
return Y.Node.scrubVal(ArrayProto[name].apply(this._nodes, args));
View
@@ -1749,8 +1749,10 @@ <h2>test</h2>
'should slice the nodes': function() {
var nodelist1 = Y.all('div');
nodelist2 = nodelist1.slice(1, 4);
nodelist3 = nodelist1.slice(0, 3);
ArrayAssert.itemsAreEqual(nodelist1._nodes.slice(1, 4), nodelist2._nodes);
ArrayAssert.itemsAreEqual(nodelist1._nodes.slice(0, 3), nodelist3._nodes);
},
'should splice the nodes': function() {

0 comments on commit 06e08ff

Please sign in to comment.