Skip to content
This repository was archived by the owner on Apr 12, 2024. It is now read-only.

Commit fa74b0b

Browse files
committed
perf(jqLite): move bind/unbind definitions out of the loop
The bind/unbind aliases to on/off were being assinged in every iteration of the function assigning traversal methods to the prototype. Now it happens only once.
1 parent 84dce87 commit fa74b0b

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/jqLite.js

+4-4
Original file line numberDiff line numberDiff line change
@@ -1060,12 +1060,12 @@ forEach({
10601060
}
10611061
return isDefined(value) ? value : this;
10621062
};
1063-
1064-
// bind legacy bind/unbind to on/off
1065-
JQLite.prototype.bind = JQLite.prototype.on;
1066-
JQLite.prototype.unbind = JQLite.prototype.off;
10671063
});
10681064

1065+
// bind legacy bind/unbind to on/off
1066+
JQLite.prototype.bind = JQLite.prototype.on;
1067+
JQLite.prototype.unbind = JQLite.prototype.off;
1068+
10691069

10701070
// Provider for private $$jqLite service
10711071
/** @this */

0 commit comments

Comments
 (0)