-
Notifications
You must be signed in to change notification settings - Fork 781
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Core: Optimise module allocation, hoist some functions, clarify code
Two micro optimisations: * Move the declaration of the hooks object to where the internal module is created more generally. Adding the property later seems confusing and was less optimal. * Move two utility functions from within processModule() to outside of it as they didn't use any of its scope and thus were needlessly being re-allocated for every registered test module. Clarity: * Move `module.hooks` and `module.stats` property definitions to the module object literal rather than creating them sometime later as dynamic properties. * Clarify that the unnamed module is not (and should not become) a "global module". I was thinking of doing this as a way to implement the upcoming global QUnit.hooks feature, but then remembered that these are two distinct concepts that I think are best kept separate. This is preparation for #1475, ref https://github.com/qunitjs/qunitjs.com/issues/161.
- Loading branch information
Showing
7 changed files
with
100 additions
and
50 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters