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

Commit 7717b96

Browse files
mgolpetebacondarwin
authored andcommitted
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 cc54e43 commit 7717b96

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/jqLite.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1067,12 +1067,12 @@ forEach({
10671067
}
10681068
return isDefined(value) ? value : this;
10691069
};
1070-
1071-
// bind legacy bind/unbind to on/off
1072-
JQLite.prototype.bind = JQLite.prototype.on;
1073-
JQLite.prototype.unbind = JQLite.prototype.off;
10741070
});
10751071

1072+
// bind legacy bind/unbind to on/off
1073+
JQLite.prototype.bind = JQLite.prototype.on;
1074+
JQLite.prototype.unbind = JQLite.prototype.off;
1075+
10761076

10771077
// Provider for private $$jqLite service
10781078
/** @this */

0 commit comments

Comments
 (0)