Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix for .pipe method after the update to 1.7 #4

Merged
merged 1 commit into from
Jan 5, 2012
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
5 changes: 4 additions & 1 deletion index.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
(function(define){
define([], function(){

var forEach = Array.prototype.forEach;
var hasOwn = Object.prototype.hasOwnProperty;
var breaker = {};
var isArray = function( elem ) {
return typeof elem === "object" && elem instanceof Array;
};
Expand Down Expand Up @@ -274,7 +277,7 @@
done: [ fnDone, "resolve" ],
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hummmm... Do we really need to complicate things by defining _each when _each is only used once here. This is a trivial process to iterate over the keys and in a for loop. I suppose this refactoring this part to be non-functional will further deviate from jQueries 1.7 source, but the positive side would be _each and line 4 can be completely removed.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's your call; I would suggest accepting this for now, though, and then refactoring if you decide you want to. I'm not concerned about the code size on the server, but I am concerned about the functionality =]

The only reason for doing it this way is, as you say, to remain as close as possible to jquery source.

fail: [ fnFail, "reject" ],
progress: [ fnProgress, "notify" ]
}, function( handler, data ) {
}, function( data, handler ) {
var fn = data[ 0 ],
action = data[ 1 ],
returned;
Expand Down