#14724 closed defect (fixed)
require() creates synthetic MIDs when passed a zero length array
Reported by: | Kitson Kelly | Owned by: | Rawld Gill |
---|---|---|---|
Priority: | undecided | Milestone: | 1.7.2 |
Component: | Loader | Version: | 1.7.1 |
Keywords: | Cc: | ||
Blocked By: | Blocking: |
Description
When require is passed a zero length array, it goes ahead and creates a synthetic MID for controlling the loading of the additional modules, although it doesn't need to do anything.
For example the following will create a synthetic MID that does nothing:
require([], function(){ console.log("hello!"); });
It was discovered while I was working on #14591 and the parser performance tests where when there were no MIDs being passed to require, it was still creating thousands and thousands of synthetic MIDs.
The attached patch checks for zero arrays, but there maybe a better way to "re-use" the sythentic MID for control on multiple invocations of require(), irrespective of it being empty or not.
Attachments (1)
Change History (5)
Changed 9 years ago by
Attachment: | dojo_require-zero-array.patch added |
---|
comment:4 Changed 9 years ago by
Milestone: | 1.8 → 1.7.2 |
---|
Note: See
TracTickets for help on using
tickets.
Addresses issue with require and zero length array