fix: _interopRequireWildcard should only cache objects (#10574)
* fix: [#10561] _interopRequireWildcard should cache object only * fix: narrow down cache restriction to object/function type * test: add interop require null module case
This commit is contained in:
committed by
Nicolò Ribaudo
parent
78cd63d9cf
commit
fe258dec04
@@ -620,6 +620,10 @@ helpers.interopRequireWildcard = helper("7.0.0-beta.0")`
|
||||
return obj;
|
||||
}
|
||||
|
||||
if (obj === null || (typeof obj !== "object" && typeof obj !== "function")) {
|
||||
return { default: obj }
|
||||
}
|
||||
|
||||
var cache = _getRequireWildcardCache();
|
||||
if (cache && cache.has(obj)) {
|
||||
return cache.get(obj);
|
||||
|
||||
Reference in New Issue
Block a user