Skip to content

Commit

Permalink
Merge branch 't5476' of https://github.com/jitter/jquery into jitter-…
Browse files Browse the repository at this point in the history
…t5476
  • Loading branch information
jeresig committed Dec 6, 2010
2 parents d4a9d45 + 5c0b5d2 commit df3441b
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion src/core.js
Original file line number Diff line number Diff line change
Expand Up @@ -215,7 +215,7 @@ jQuery.fn = jQuery.prototype = {
this.toArray() :

// Return just the object
( num < 0 ? this.slice(num)[ 0 ] : this[ num ] );
( num < 0 ? this[ this.length + num ] : this[ num ] );
},

// Take an array of elements and push it onto the stack
Expand Down
10 changes: 5 additions & 5 deletions test/unit/core.js
Original file line number Diff line number Diff line change
Expand Up @@ -547,15 +547,15 @@ test("toArray()", function() {
})

test("get(Number)", function() {
expect(1);
expect(2);
equals( jQuery("p").get(0), document.getElementById("firstp"), "Get A Single Element" );
strictEqual( jQuery("#firstp").get(1), undefined, "Try get with index larger elements count" );
});

test("get(-Number)",function() {
expect(1);
equals( jQuery("p").get(-1),
document.getElementById("first"),
"Get a single element with negative index" )
expect(2);
equals( jQuery("p").get(-1), document.getElementById("first"), "Get a single element with negative index" );
strictEqual( jQuery("#firstp").get(-2), undefined, "Try get with index negative index larger then elements count" );
})

test("each(Function)", function() {
Expand Down

0 comments on commit df3441b

Please sign in to comment.