Skip to content

Commit 9ee8faa

Browse files
committed
Merge branch 'refs/heads/bugfix/lazy-init-external-dep'
2 parents 49855dc + 32640ad commit 9ee8faa

File tree

1 file changed

+11
-6
lines changed

1 file changed

+11
-6
lines changed

module/js/integrations/ChrisPremades.js

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -122,11 +122,16 @@ export class IntegrationChrisPremades extends StartupHookMixin(IntegrationBase)
122122
"vehicle",
123123
]);
124124

125-
_entsJsonBlocklist = {
126-
"item": [
127-
{name: "Shield", source: Parser.SRC_PHB}, // Avoid collision with spell of the same name
128-
],
129-
};
125+
// Lazy init to avoid `Parser` being unavailable
126+
static __entsJsonBlocklist = null;
127+
128+
static get _entsJsonBlocklist () {
129+
return this.__entsJsonBlocklist ||= {
130+
"item": [
131+
{name: "Shield", source: Parser.SRC_PHB}, // Avoid collision with spell of the same name
132+
],
133+
};
134+
}
130135

131136
async _pGetExpandedAddonData (
132137
{
@@ -146,7 +151,7 @@ export class IntegrationChrisPremades extends StartupHookMixin(IntegrationBase)
146151
|| this._propsJsonBlocklist.has(propJson)
147152
) return null;
148153

149-
const jsonBlocklist = this._entsJsonBlocklist[propJson];
154+
const jsonBlocklist = this.constructor._entsJsonBlocklist[propJson];
150155
if (jsonBlocklist?.length && jsonBlocklist.some(it => fnMatch(it))) return null;
151156

152157
return this._pGetExpandedAddonData_pWithStubs({

0 commit comments

Comments
 (0)